/** * @param array $by * @return bool */ public function delete(array $by) { $article = $this->find($by['idArticle'], $by['lang']); if (!$article) { throw new EntityExistsException('Tento článek neexistuje'); } $this->imageMapper->delete(articleImagesPath . $article->image); return parent::delete($by); }
/** * @param array $by * @return bool */ public function delete(array $by) { $offer = $this->find($by['idOffer'], $by['lang']); if (!$offer) { throw new EntityExistsException('Tato nabídka neexistuje'); } $this->imageMapper->delete(offerImagesPath . $offer->image); return parent::delete($by); }
/** * @param string $idGallery * @param string $lang * @param string $image */ public function deleteImage($idGallery, $lang, $image) { $this->imageMapper->delete(galleryPath . $idGallery . '_' . $lang . DIRECTORY_SEPARATOR . $image); }