public function move($newPath) { if ($thumbnail = $this->getThumbnail()) { $newDir = $this->getRootPath() . '/' . $this->getRelativePathDirectory() . '/' . sfSympalConfig::get('assets', 'thumbnails_dir'); } parent::move($newPath); if ($thumbnail) { $thumbnail->move($newDir . '/' . $this->getName()); } }
/** * In addition to moving this image, all the thumbnails must all be moved * * @see sfSympalAssetObject::move() */ public function move($newPath) { $originalPathDirectory = $this->getPathDirectory(); $thumbnails = $this->getAllThumbnails(); parent::move($newPath); foreach ($thumbnails as $thumbnail) { $newThumbPath = str_replace($originalPathDirectory, dirname($newPath), $thumbnail->getPath()); $thumbnail->move($newThumbPath); } }