Method | Description | |
---|---|---|
afterDelete ( Cake\Event\Event $event, Cake\ORM\Entity $entity, ArrayObject $options ) : void | false | Deletes the files after the entity is deleted | |
beforeMarshal ( Cake\Event\Event $event, ArrayObject $data, ArrayObject $options ) : void | Modifies the data being marshalled to ensure invalid upload data is not inserted | |
beforeSave ( Cake\Event\Event $event, Cake\ORM\Entity $entity, ArrayObject $options ) : void | false | Modifies the entity before it is saved so that uploaded file data is persisted in the database too. | |
constructFiles ( Cake\ORM\Entity $entity, array $data, string $field, array $settings, string $basepath ) : array | Creates a set of files from the initial data and returns them as key/value pairs, where the path on disk maps to name which each file should have. | |
getPathProcessor ( Cake\ORM\Entity $entity, array $data, string $field, array $settings ) : Josegonzalez\Upload\File\Path\AbstractProcessor | Retrieves an instance of a path processor which knows how to build paths for a given file upload | |
getWriter ( Cake\ORM\Entity $entity, array $data, string $field, array $settings ) : Josegonzalez\Upload\File\Path\AbstractProcessor | Retrieves an instance of a file writer which knows how to write files to disk | |
initialize ( array $config ) : void | Initialize hook |
public afterDelete ( Cake\Event\Event $event, Cake\ORM\Entity $entity, ArrayObject $options ) : void | false | ||
$event | Cake\Event\Event | The afterDelete event that was fired |
$entity | Cake\ORM\Entity | The entity that was deleted |
$options | ArrayObject | the options passed to the delete method |
return | void | false |
public beforeMarshal ( Cake\Event\Event $event, ArrayObject $data, ArrayObject $options ) : void | ||
$event | Cake\Event\Event | an event instance |
$data | ArrayObject | data being marshalled |
$options | ArrayObject | options for the current event |
return | void |
public beforeSave ( Cake\Event\Event $event, Cake\ORM\Entity $entity, ArrayObject $options ) : void | false | ||
$event | Cake\Event\Event | The beforeSave event that was fired |
$entity | Cake\ORM\Entity | The entity that is going to be saved |
$options | ArrayObject | the options passed to the save method |
return | void | false |
public constructFiles ( Cake\ORM\Entity $entity, array $data, string $field, array $settings, string $basepath ) : array | ||
$entity | Cake\ORM\Entity | an entity |
$data | array | the data being submitted for a save |
$field | string | the field for which data will be saved |
$settings | array | the settings for the current field |
$basepath | string | a basepath where the files are written to |
return | array | key/value pairs of temp files mapping to their names |
public getPathProcessor ( Cake\ORM\Entity $entity, array $data, string $field, array $settings ) : Josegonzalez\Upload\File\Path\AbstractProcessor | ||
$entity | Cake\ORM\Entity | an entity |
$data | array | the data being submitted for a save |
$field | string | the field for which data will be saved |
$settings | array | the settings for the current field |
return | Josegonzalez\Upload\File\Path\AbstractProcessor |
public getWriter ( Cake\ORM\Entity $entity, array $data, string $field, array $settings ) : Josegonzalez\Upload\File\Path\AbstractProcessor | ||
$entity | Cake\ORM\Entity | an entity |
$data | array | the data being submitted for a save |
$field | string | the field for which data will be saved |
$settings | array | the settings for the current field |
return | Josegonzalez\Upload\File\Path\AbstractProcessor |
public initialize ( array $config ) : void | ||
$config | array | The config for this behavior. |
return | void |