예제 #1
0
 public function validate(SxModule_Topcontentblock $object)
 {
     $this->validateTextRequired($object->getTitle(), 'title', 'content');
     $this->validateTextRequired($object->getContent(), 'content', 'content');
     $msgr = Sanmax_MessageStack::getInstance($this->_namespace);
     if (!$msgr->getNamespaceMessages()) {
         return true;
     }
     return false;
 }
예제 #2
0
 public function toArray(SxModule_Topcontentblock $item, $type = '*')
 {
     $data = array('blockname' => $item->getBlockname());
     $tsl = array('lng' => $item->getLng(), 'title' => $item->getTitle(), 'content' => $item->getContent(), 'url' => $item->getUrl(), 'picture' => $item->getPicture());
     if ($type == 'item') {
         return $data;
     } elseif ($type == 'tsl') {
         return $tsl;
     }
     return array_merge($data, $tsl);
 }