/** * 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; } }