Пример #1
0
 /**
  * Removes all posts associated with category id
  * 
  * @param string $id Category's id
  * @return boolean
  */
 private function removeAllPostsById($id)
 {
     $webPageIds = $this->postMapper->fetchAllWebPageIdsByCategoryId($id);
     // Remove associated web pages, first
     foreach ($webPageIds as $webPageId) {
         $this->webPageManager->deleteById($webPageId);
     }
     // And then remove all posts
     $this->postMapper->deleteAllByCategoryId($id);
     return true;
 }