public function validate(SxModule_Eyecatchers $object) { $this->validateTextRequired($object->getTitle(), 'title', 'content'); $this->validateTextRequired($object->getSubtitle(), 'subtitle', 'content'); $msgr = Sanmax_MessageStack::getInstance($this->_namespace); if (!$msgr->getNamespaceMessages()) { return true; } else { return false; } }
public function toArray(SxModule_Eyecatchers $item, $type = '*') { $data = array('id' => $item->getId(), 'date_created' => $item->getDateCreated(), 'date_updated' => $item->getDateUpdated(), 'picture' => $item->getPicture(), 'place' => $item->getPlace(), 'active' => $item->getActive()); $tsl = array('tsl_id' => $item->getTslId(), 'lng' => $item->getLng(), 'url' => $item->getUrl(), 'title' => $item->getTitle(), 'subtitle' => $item->getSubtitle()); if ($type == 'item') { return $data; } elseif ($type == 'tsl') { return $tsl; } return array_merge($data, $tsl); }