src/Model/Behavior/UploadBehavior.php
public function getPathProcessor(Entity $entity, $data, $field, $settings)
    {
        $default = 'Josegonzalez\Upload\File\Path\DefaultProcessor';
        $processorClass = Hash::get($settings, 'pathProcessor', $default);
        if (is_subclass_of($processorClass, 'Josegonzalez\Upload\File\Path\ProcessorInterface')) {
            return new $processorClass($this->_table, $entity, $data, $field, $settings);
        }

        throw new UnexpectedValueException(sprintf(
            "'pathProcessor' not set to instance of ProcessorInterface: %s",
            $processorClass
        ));
    }
public function getPathProcessor(Entity $entity, $data, $field, $settings)
    {
        $default = 'Josegonzalez\Upload\File\Path\DefaultProcessor';
        $processorClass = Hash::get($settings, 'pathProcessor', $default);
        if (is_subclass_of($processorClass, 'Josegonzalez\Upload\File\Path\ProcessorInterface')) {
            return new $processorClass($this->_table, $entity, $data, $field, $settings);
        }

        throw new UnexpectedValueException(sprintf(
            "'pathProcessor' not set to instance of ProcessorInterface: %s",
            $processorClass
        ));
    }
public function getPathProcessor ( Entity $ entity , $ data , $ field , $ settings ) { $ default = 'Josegonzalez\Upload\File\Path\DefaultProcessor' ; $ processorClass = Hash :: get ( $ settings , 'pathProcessor' , $ default ) ; if ( is_subclass_of ( $ processorClass , 'Josegonzalez\Upload\File\Path\ProcessorInterface' ) ) { return new $ processorClass ( $ this -> _table , $ entity , $ data , $ field , $ settings ) ; } throw new UnexpectedValueException ( sprintf ( "'pathProcessor' not set to instance of ProcessorInterface: %s" , $ processorClass ) ) ; }
Retrieves an instance of a path processor which knows how to build paths
for a given file upload

@param \Cake\ORM\Entity $entity an entity
@param array $data the data being submitted for a save
@param string $field the field for which data will be saved
@param array $settings the settings for the current field
@return \Josegonzalez\Upload\File\Path\AbstractProcessor
Retrieves an instance of a path processor which knows how to build paths for a given file upload