private function deletaGallery() { $ReadGallery = new WsPostsGallery(); $ReadGallery->setPost_id($this->Post); $ReadGallery->Query("WHERE #post_id#"); if ($ReadGallery->getResult()) { foreach ($ReadGallery->getResult() as $gbdel) { $this->deletaImagem('../uploads/' . $gbdel->gallery_image); } } $ReadGallery->setPost_id($this->Post); $ReadGallery->delete("post_id = :post_id"); }