public function validate(SxModule_Contentblock $object) { $this->validateTextRequired($object->getTitle(), 'title', 'content'); $this->validateLongTextareaRequired($object->getContent(), 'content', 'content'); $msgr = Sanmax_MessageStack::getInstance($this->_namespace); if (!$msgr->getNamespaceMessages()) { return true; } return false; }
public function toArray(SxModule_Contentblock $item, $type = '*') { $data = array('id' => $item->getId(), 'blockname' => $item->getBlockname(), 'active' => $item->getActive()); $tsl = array('tsl_id' => $item->getTslId(), 'lng' => $item->getLng(), 'title' => $item->getTitle(), 'content' => $item->getContent()); if ($type == 'item') { return $data; } elseif ($type == 'tsl') { return $tsl; } return array_merge($data, $tsl); }