/** * Odstranuje obrazek clanku vcetne nahledu * @param Entities\Article $article */ public function deleteArticleImage($article) { if (!$article->hasImage()) { return; } //odstranit puvodni obr vcetne nahledu $oldImage = $article->getImage(); $oldImagePath = $this->wwwDir . $oldImage->image; if (file_exists($oldImagePath)) { unlink($oldImagePath); } $oldImagePath = $this->wwwDir . $oldImage->getThumbnail(); if (file_exists($oldImagePath)) { unlink($oldImagePath); } $article->setImage(); }