paste() защищенный Метод

Copy/move files into new destination
Автор: Dmitry (dio) Levashov
protected paste ( $args ) : array
Результат array
Пример #1
0
 protected function paste($args)
 {
     $result = parent::paste($args);
     $dest = $this->getPath($args['dst']);
     $cut = !empty($args['cut']);
     if ($cut) {
         foreach ($args['targets'] as $target) {
             // If the image has a corresponding Visual, update its .path field and move its thumbnail.
             $path = $this->getPath($target);
             $v = Visual::get_by_path($path);
             if ($v) {
                 $base = basename($path);
                 $v->path = $dest ? "{$dest}/{$base}" : $base;
                 $v->save();
             }
         }
     }
     return $result;
 }