0, 'title' => null, 'content' => null, 'pubDate' => null, 'author' => null, 'isPublished' => false ); public function setAttribs(array $data) { foreach ($data as $key => $value) { switch(strtolower($key)) { case 'title': $this->setTitle($value); break; case 'content': $this->setContent($value); break; case 'author': $this->setAuthor($value); break; case 'pubdate': $this->setPubDate(new Zend_Date($value)); break; } } } public function setId($id) { if (is_numeric($id)) $this->_data['id'] = $id; } public function setTitle($title) { if (is_string($title) && null == $title[30]) { $this->_data['title'] = $title; return true; } return false; } public function setContent($content) { if (is_string($content)) { $this->_data['content'] = $content; return true; } return false; } public function setAuthor($author) { if ($author instanceof User) { $this->_data['author'] = $author; return true; } return false; } public function setPubDate($date) { if (Fiktiv_Date::isDate($date)) { $this->_data['pubDate'] = new Fiktiv_Date($date); } else if ($date instanceof Zend_Date) { $this->_data['pubDate'] = $date; } else { return false; } return true; } public function isPublished($flag = null) { if (null === $flag) { return $this->_data['isPublished']; } $this->_data['isPublished'] = (boolean)$flag; } }