Example #1
0
 /**
  * Returns all answer entities associated with particular category id
  * 
  * @param string $id Category id
  * @return array
  */
 public function getAnswersByCategoryId($id)
 {
     $name = $this->categoryMapper->fetchNameById($id);
     $answers = $this->answerManager->fetchAllByCategoryId($id, true);
     if (!empty($name) && !empty($answers)) {
         $entity = new VirtualEntity();
         $entity->setName($name, VirtualEntity::FILTER_TAGS)->setCategoryId($id, VirtualEntity::FILTER_INT)->setAnswers($answers);
         return $entity;
     } else {
         return false;
     }
 }
Example #2
0
 /**
  * Updates a category
  * 
  * @param array $input Raw input data
  * @return boolean
  */
 public function update(array $input)
 {
     return $this->categoryMapper->update($input);
 }