src/CRUDlex/FileHandler.php
public function deleteFile(AbstractData $data, Entity $entity, $entityName, $field)
    {
        $result = $data->getEvents()->shouldExecute($entity, 'before', 'deleteFile');
        if (!$result) {
            return false;
        }
        // For now, we are defensive and don't delete ever. As soon as soft deletion is optional, files will get deleted.
        $data->getEvents()->shouldExecute($entity, 'after', 'deleteFile');
        return true;
    }
public function deleteFile(AbstractData $data, Entity $entity, $entityName, $field)
    {
        $result = $data->getEvents()->shouldExecute($entity, 'before', 'deleteFile');
        if (!$result) {
            return false;
        }
        // For now, we are defensive and don't delete ever. As soon as soft deletion is optional, files will get deleted.
        $data->getEvents()->shouldExecute($entity, 'after', 'deleteFile');
        return true;
    }
public function deleteFile ( AbstractData $ data , Entity $ entity , $ entityName , $ field ) { $ result = $ data -> getEvents ( ) -> shouldExecute ( $ entity , 'before' , 'deleteFile' ) ; if ( ! $ result ) { return false ; } // For now, we are defensive and don't delete ever. As soon as soft deletion is optional, files will get deleted. $ data -> getEvents ( ) -> shouldExecute ( $ entity , 'after' , 'deleteFile' ) ; return true ; }
Deletes a specific file from an existing entity.

@param AbstractData $data
the AbstractData instance who should receive the events
@param Entity $entity
the entity to delete the file from
@param string $entityName
the name of the entity as this class here is not aware of it
@param string $field
the field of the entity containing the file to be deleted
@return bool true on successful deletion
true on successful deletion
Deletes a specific file from an existing entity .