示例#1
0
 public function toArray(SxModule_News $item, $type = '*')
 {
     $identity = Zend_Auth::getInstance()->getIdentity();
     $data = array('nid' => $item->getId(), 'author_id' => $identity->getId(), 'date_created' => $item->getDateCreated(), 'date_published' => $item->getDatePublished(), 'date_expired' => $item->getDateExpired(), 'date_message' => $item->getDateByMessage(), 'picture' => $item->getPicture());
     $tsl = array('lng' => $item->getLng(), 'title' => $item->getTitle(), 'summary' => $item->getSummary(), 'content' => $item->getContent(), 'url' => $item->_createUrl(), 'seo_keywords' => $item->getSeoKeywords(), 'seo_title' => $item->getSeoTitle(), 'seo_description' => $item->getSeoDescription(), 'active' => (int) $item->getActive());
     if ($type == 'item') {
         return $data;
     } elseif ($type == 'tsl') {
         return $tsl;
     }
     return array_merge($data, $tsl);
 }