protected function _moveFile(Entity $entity, $source = false, $destination = false, $field = false, array $options = [])
    {
        if ($source === false || $destination === false || $field === false) {
            return false;
        }

        if (isset($options['overwrite']) && is_bool($options['overwrite'])) {
            $this->_overwrite = $options['overwrite'];
        }

        if ($this->_overwrite) {
            $this->_deleteOldUpload($entity, $field, $destination, $options);
        }

        $file = new File($source, false, 0755);

        if ($file->copy($this->_config['root'] . $destination, $this->_overwrite)) {
            return true;
        }

        return false;
    }
protected function _moveFile(Entity $entity, $source = false, $destination = false, $field = false, array $options = [])
    {
        if ($source === false || $destination === false || $field === false) {
            return false;
        }

        if (isset($options['overwrite']) && is_bool($options['overwrite'])) {
            $this->_overwrite = $options['overwrite'];
        }

        if ($this->_overwrite) {
            $this->_deleteOldUpload($entity, $field, $destination, $options);
        }

        $file = new File($source, false, 0755);

        if ($file->copy($this->_config['root'] . $destination, $this->_overwrite)) {
            return true;
        }

        return false;
    }
protected function _moveFile ( Entity $ entity , $ source = false , $ destination = false , $ field = false , array $ options = [ ] ) { if ( $ source === false || $ destination === false || $ field === false ) { return false ; } if ( isset ( $ options [ 'overwrite' ] ) && is_bool ( $ options [ 'overwrite' ] ) ) { $ this -> _overwrite = $ options [ 'overwrite' ] ; } if ( $ this -> _overwrite ) { $ this -> _deleteOldUpload ( $ entity , $ field , $ destination , $ options ) ; } $ file = new File ( $ source , false , 0755 ) ; if ( $ file -> copy ( $ this -> _config [ 'root' ] . $ destination , $ this -> _overwrite ) ) { return true ; } return false ; }
Move the temporary source file to the destination file.

@param \Cake\ORM\Entity $entity      The entity that is going to be saved.
@param bool|string      $source      The temporary source file to copy.
@param bool|string      $destination The destination file to copy.
@param bool|string      $field       The current field to process.
@param array            $options     The configuration options defined by the user.

@return bool
Move the temporary source file to the destination file .