public function validate(SxModule_Webtv $object) { $this->validateTextRequired($object->getTitle(), 'title', 'settings', $this->_namespace); $this->validateTextRequired($object->getYoutube(), 'youtube', 'settings', $this->_namespace); $this->validateTextRequired($object->getDatePublished(), 'date_published', 'settings', $this->_namespace); $this->validateTextRequired($object->getDescription(), 'description', 'content', $this->_namespace); $msgr = Sanmax_MessageStack::getInstance($this->_namespace); if (!$msgr->getNamespaceMessages()) { return true; } return false; }
public function toArray(SxModule_Webtv $item, $type = '*') { $identity = Zend_Auth::getInstance()->getIdentity(); $data = array('id' => $item->getId(), 'author_id' => $identity->getId(), 'date_created' => $item->getDateCreated(), 'date_updated' => $item->getDateUpdated(), 'date_published' => $item->getDatePublished(), 'youtube' => $item->getYoutube()); $tsl = array('url' => $item->getUrl(), 'title' => $item->getTitle(), 'description' => $item->getDescription(), 'active' => $item->getActive(), 'lng' => $item->getLng()); if ($type == 'item') { return $data; } elseif ($type == 'tsl') { return $tsl; } return array_merge($data, $tsl); }