SaveController.php
45 * | _in_ / _out_ | Key/value pairs of serialized object ids and PersistentObject instances to save
46 * | _in_ `uploadDir` | The directory where attached files should be stored on the server (optional) (see SaveController::getUploadDir())
142 if ($curRequestObject instanceof PersistentObject && ($curOid = ObjectId::parse($curOidStr)) != null
288 ApplicationError::get('OBJECT_IS_LOCKED', ['lockedOids' => [$lock->getObjectId()->__toString()]])
343 * @param $data An associative array with keys 'name', 'type', 'tmp_name' as contained in the php $_FILES array.
380 // upload file (mimeTypes parameter is set to null, because the mime type is already checked by checkFile method)
393 * an associative array with keys 'name', 'type', 'tmp_name' as contained in the php $_FILES array.
Session is the interface for session implementations and defines access to session variables.
Definition: Session.php:19
ValidationException signals an exception in validation.
Definition: ValidationException.php:18
EventManager is responsible for dispatching events to registered listeners.
Definition: EventManager.php:21
static fromException(\Exception $ex)
Factory method for transforming an exception into an ApplicationError instance.
Definition: ApplicationError.php:172
OptimisticLockException signals an exception when trying to create an optimistic lock.
Definition: OptimisticLockException.php:19
doExecute($method=null)
Definition: SaveController.php:123
shouldOverride(ObjectId $oid, $valueName, $filename)
Determine what to do if a file with the same name already exists.
Definition: SaveController.php:437
isFileUpload(array $data)
Check if the given data defines a file upload.
Definition: SaveController.php:397
getUploadFilename(ObjectId $oid, $valueName, $filename)
Get the name for the uploaded file.
Definition: SaveController.php:424
checkFile(ObjectId $oid, $valueName, $filename, $mimeType=null)
Check if the file is valid for a given object value.
Definition: SaveController.php:410
PessimisticLockException signals an exception when trying to create an pessimistic lock.
Definition: PessimisticLockException.php:21
const AFTER_COMMIT
An AFTER_COMMIT event occurs after the transaction is committed.
Definition: TransactionEvent.php:35
TransactionEvent instances are fired at different phases of a transaction.
Definition: TransactionEvent.php:23
ObjectId is the unique identifier of an object.
Definition: ObjectId.php:28
BuildDepth values are used to define the depth when loading object trees.
Definition: BuildDepth.php:19
requireTransaction()
Start or join a transaction that will be committed at the end of execution.
Definition: Controller.php:334
Implementations of Configuration give access to the application configuration.
Definition: Configuration.php:32
Instances of ReferenceDescription describe reference attributes of PersistentObjects.
Definition: ReferenceDescription.php:21
ApplicationError is used to signal errors that occur while processing a request.
Definition: ApplicationError.php:41
static parse($oid)
Parse a serialized object id string into an ObjectId instance.
Definition: ObjectId.php:135
static get($code, $data=null)
Factory method for retrieving a predefined error instance.
Definition: ApplicationError.php:144
PersistenceFacade defines the interface for PersistenceFacade implementations.
Definition: PersistenceFacade.php:23
ApplicationException signals a general application exception.
Definition: ApplicationException.php:22
SaveController is a controller that saves Node data.
Definition: SaveController.php:55
FileUtil provides basic support for file functionality like HTTP file upload.
Definition: FileUtil.php:22
const STATE_CLEAN
Definition: PersistentObject.php:25
saveUploadFile(ObjectId $oid, $valueName, array $data)
Save uploaded file.
Definition: SaveController.php:346
__construct(Session $session, PersistenceFacade $persistenceFacade, PermissionManager $permissionManager, ActionMapper $actionMapper, Localization $localization, Message $message, Configuration $configuration, EventManager $eventManager)
Constructor.
Definition: SaveController.php:76
Controller is the base class of all controllers.
Definition: Controller.php:49
PersistentObject defines the interface of all persistent objects.
Definition: PersistentObject.php:23
getUploadDir(ObjectId $oid, $valueName)
Get the name of the directory to upload a file to and make sure that it exists.
Definition: SaveController.php:451
ActionMapper implementations are responsible for instantiating and executing Controllers based on the...
Definition: ActionMapper.php:21
addListener($eventName, $callback)
Register a listener for a given event.
static isValid($oid)
Check if a serialized ObjectId has a valid syntax, the type is known and if the number of primary key...
Definition: ObjectId.php:123
PermissionManager implementations are used to handle all authorization requests.
Definition: PermissionManager.php:20
Localization defines the interface for storing localized entity instances and retrieving them back.
Definition: Localization.php:32
checkLanguageParameter()
Checks the language request parameter and adds an response error, if it is not contained in the Local...
Definition: Controller.php:381
Message is used to get localized messages to be used in the user interface.
Definition: Message.php:23