Esempio n. 1
0
 /**
  * Deletes a category by its associated id
  * 
  * @param string $id Category id
  * @return boolean
  */
 public function deleteById($id)
 {
     // Grab category's name before we remove it
     $name = Filter::escape($this->categoryMapper->fetchNameById($id));
     if ($this->categoryMapper->deleteById($id) && $this->announceMapper->deleteAllByCategoryId($id)) {
         $this->track('Category "%s" has been removed', $name);
         return true;
     } else {
         return false;
     }
 }
Esempio n. 2
0
 /**
  * Deletes an announce by its associated id
  * 
  * @param string $id Announce id
  * @return boolean
  */
 private function delete($id)
 {
     $webPageId = $this->announceMapper->fetchWebPageIdById($id);
     $this->webPageManager->deleteById($webPageId);
     return $this->announceMapper->deleteById($id);
 }