PHP Class Josegonzalez\Upload\File\Writer\DefaultWriter

Inheritance: implements Josegonzalez\Upload\File\Writer\WriterInterface
Datei anzeigen Open project: josegonzalez/cakephp-upload

Protected Properties

Property Type Description
$data array Array of uploaded data for this field
$entity Cake\ORM\Entity Entity instance.
$field string Name of field
$settings array Settings for processing a path
$table Cake\ORM\Table Table instance.

Public Methods

Method Description
__construct ( Table $table, Cake\ORM\Entity $entity, array $data, string $field, array $settings ) Constructs a writer
delete ( array $files ) : array Deletes a set of files to an output
deletePath ( League\Flysystem\FilesystemInterface $filesystem, string $path ) : boolean Deletes a path from a filesystem
getFilesystem ( string $field, array $settings = [] ) : League\Flysystem\FilesystemInterface Retrieves a configured filesystem for the given field
write ( array $files ) : array Writes a set of files to an output
writeFile ( League\Flysystem\FilesystemInterface $filesystem, string $file, string $path ) : boolean Writes a set of files to an output

Method Details

__construct() public method

Constructs a writer
public __construct ( Table $table, Cake\ORM\Entity $entity, array $data, string $field, array $settings )
$table Cake\ORM\Table the instance managing the entity
$entity Cake\ORM\Entity the entity to construct a path for.
$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

delete() public method

Deletes a set of files to an output
public delete ( array $files ) : array
$files array the files being written out
return array array of results

deletePath() public method

Deletes a path from a filesystem
public deletePath ( League\Flysystem\FilesystemInterface $filesystem, string $path ) : boolean
$filesystem League\Flysystem\FilesystemInterface a filesystem writer
$path string the path that should be deleted
return boolean

getFilesystem() public method

Retrieves a configured filesystem for the given field
public getFilesystem ( string $field, array $settings = [] ) : League\Flysystem\FilesystemInterface
$field string the field for which data will be saved
$settings array the settings for the current field
return League\Flysystem\FilesystemInterface

write() public method

Writes a set of files to an output
public write ( array $files ) : array
$files array the files being written out
return array array of results

writeFile() public method

Writes a set of files to an output
public writeFile ( League\Flysystem\FilesystemInterface $filesystem, string $file, string $path ) : boolean
$filesystem League\Flysystem\FilesystemInterface a filesystem wrapper
$file string a full path to a temp file
$path string that path to which the file should be written
return boolean

Property Details

$data protected_oe property

Array of uploaded data for this field
protected array $data
return array

$entity protected_oe property

Entity instance.
protected Entity,Cake\ORM $entity
return Cake\ORM\Entity

$field protected_oe property

Name of field
protected string $field
return string

$settings protected_oe property

Settings for processing a path
protected array $settings
return array

$table protected_oe property

Table instance.
protected Table,Cake\ORM $table
return Cake\ORM\Table