protected function _renameAndMove(Model $model, File $file, array $options) {
        $nameCallback = null;

        if ($options['nameCallback'] && method_exists($model, $options['nameCallback'])) {
            $nameCallback = array($model, $options['nameCallback']);
        }

        if ($options['uploadDir']) {
            $file->move($options['uploadDir'], $options['overwrite']);
        }

        $file->rename($nameCallback, $options['append'], $options['prepend'], $options['overwrite']);

        return (string) $options['finalPath'] . $file->basename();
    }
protected function _renameAndMove(Model $model, File $file, array $options) {
        $nameCallback = null;

        if ($options['nameCallback'] && method_exists($model, $options['nameCallback'])) {
            $nameCallback = array($model, $options['nameCallback']);
        }

        if ($options['uploadDir']) {
            $file->move($options['uploadDir'], $options['overwrite']);
        }

        $file->rename($nameCallback, $options['append'], $options['prepend'], $options['overwrite']);

        return (string) $options['finalPath'] . $file->basename();
    }
protected function _renameAndMove ( Model $ model , File $ file , array $ options ) { $ nameCallback = null ; if ( $ options [ 'nameCallback' ] && method_exists ( $ model , $ options [ 'nameCallback' ] ) ) { $ nameCallback = array ( $ model , $ options [ 'nameCallback' ] ) ; } if ( $ options [ 'uploadDir' ] ) { $ file -> move ( $ options [ 'uploadDir' ] , $ options [ 'overwrite' ] ) ; } $ file -> rename ( $ nameCallback , $ options [ 'append' ] , $ options [ 'prepend' ] , $ options [ 'overwrite' ] ) ; return ( string ) $ options [ 'finalPath' ] . $ file -> basename ( ) ; }
Rename or move the file and return its relative path.

@param Model $model
@param \Transit\File $file
@param array $options
@return string
Rename or move the file and return its relative path .