Example #1
0
 /**
  * Removes all images associated with given category id
  * 
  * @param string $categoryId
  * @return boolean
  */
 public function deleteAllByCategoryId($categoryId)
 {
     // Grab all ids associated with provided category id
     $ids = $this->imageMapper->fetchIdsByCategoryId($categoryId);
     // Start doing it when at least one id is present
     if (!empty($ids)) {
         foreach ($ids as $id) {
             if (!$this->delete($id, $categoryId)) {
                 return false;
             }
         }
     }
     // @TODO: Now, it's time to remove records themselves
     //$this->imageMapper->deleteAllByCategoryId($categoryId);
     return true;
 }