PHP Interface CRUDlex\FileProcessorInterface

Datei anzeigen Open project: philiplb/crudlex

Public Methods

Method Description
createFile ( Request $request, Entity $entity, string $entityName, string $field ) : void Creates the uploaded file of a newly created entity.
deleteFile ( Entity $entity, string $entityName, string $field ) : void Deletes a specific file from an existing entity.
renderFile ( Entity $entity, string $entityName, string $field ) : Response Renders (outputs) a file of an entity. This includes setting headers like the file size, mimetype and name, too.
updateFile ( Request $request, Entity $entity, string $entityName, string $field ) : void Updates the uploaded file of an updated entity.

Method Details

createFile() public method

Creates the uploaded file of a newly created entity.
public createFile ( Request $request, Entity $entity, string $entityName, string $field ) : void
$request Symfony\Component\HttpFoundation\Request the HTTP request containing the file data
$entity Entity the just created entity
$entityName string the name of the entity as this class here is not aware of it
$field string the file field
return void

deleteFile() public method

Deletes a specific file from an existing entity.
public deleteFile ( Entity $entity, string $entityName, string $field ) : void
$entity Entity the entity to delete the file from
$entityName string the name of the entity as this class here is not aware of it
$field string the field of the entity containing the file to be deleted
return void

renderFile() public method

Renders (outputs) a file of an entity. This includes setting headers like the file size, mimetype and name, too.
public renderFile ( Entity $entity, string $entityName, string $field ) : Response
$entity Entity the entity to render the file from
$entityName string the name of the entity as this class here is not aware of it
$field string the field of the entity containing the file to be rendered
return Symfony\Component\HttpFoundation\Response the HTTP response, likely to be a streamed one

updateFile() public method

Updates the uploaded file of an updated entity.
public updateFile ( Request $request, Entity $entity, string $entityName, string $field ) : void
$request Symfony\Component\HttpFoundation\Request the HTTP request containing the file data
$entity Entity the updated entity
$entityName string the name of the entity as this class here is not aware of it
$field string the file field
return void