src/CRUDlex/FileHandler.php
protected function performOnFiles(Entity $entity, $entityName, $function)
    {
        $fields = $this->entityDefinition->getEditableFieldNames();
        foreach ($fields as $field) {
            if ($this->entityDefinition->getType($field) == 'file') {
                $function($entity, $entityName, $field);
            }
        }
    }
protected function performOnFiles(Entity $entity, $entityName, $function)
    {
        $fields = $this->entityDefinition->getEditableFieldNames();
        foreach ($fields as $field) {
            if ($this->entityDefinition->getType($field) == 'file') {
                $function($entity, $entityName, $field);
            }
        }
    }
protected function performOnFiles ( Entity $ entity , $ entityName , $ function ) { $ fields = $ this -> entityDefinition -> getEditableFieldNames ( ) ; foreach ( $ fields as $ field ) { if ( $ this -> entityDefinition -> getType ( $ field ) == 'file' ) { $ function ( $ entity , $ entityName , $ field ) ; } } }
Executes a function for each file field of this entity.

@param Entity $entity
the just created entity
@param string $entityName
the name of the entity as this class here is not aware of it
@param \Closure $function
the function to perform, takes $entity, $entityName and $field as parameter
Executes a function for each file field of this entity .