Exemple #1
0
 public function createArrayOfObject(Entry $object)
 {
     $data = array();
     $data["id"] = $object->getId();
     $data["title"] = $object->getTitle();
     $data["created"] = $this->getISO8601ForUser($object->getDate());
     $source = $object->getSource();
     if ($source instanceof Email) {
         $data["type"] = "email";
     } else {
         if ($source instanceof Feed) {
             $data["type"] = "feed";
         }
     }
     $topic = $object->getTopic();
     if ($topic) {
         $data["topic"] = array("id" => $topic->getId(), "name" => $topic->getName(), "seoName" => $topic->getSeoName());
     }
     $data["category"] = array("id" => $object->getCategory()->getId(), "name" => $object->getCategory()->getName(), "forum" => array("id" => $object->getCategory()->getTargetForum()->getId(), "name" => $object->getCategory()->getTargetForum()->getName()));
     return $data;
 }