Exemple #1
0
 /**
  * Removes all web pages associated with category id
  * 
  * @param string $id Category's id
  * @return boolean
  */
 private function removePostWebPagesByCategoryId($id)
 {
     $ids = $this->postMapper->fetchWebPageIdsByCategoryId($id);
     if (!empty($ids)) {
         foreach ($ids as $id) {
             $this->webPageManager->deleteById($id);
         }
     }
     return true;
 }
Exemple #2
0
 /**
  * Removes a post by its associated id
  * 
  * @param string $id Post's id
  * @return boolean
  */
 public function deleteById($id)
 {
     $name = Filter::escape($this->postMapper->fetchNameById($id));
     if ($this->removeAllById($id)) {
         $this->track('Post "%s" has been removed', $name);
         return true;
     } else {
         return false;
     }
 }
Exemple #3
0
 /**
  * Count amount of posts associated with given category id
  * 
  * @param string $id
  * @return integer
  */
 public function getCountByCategory($id)
 {
     return $this->postMapper->countAllByCategoryId($id);
 }