Ejemplo n.º 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;
     }
 }