Archived
1
0
Fork 0

AuthLink fix + very small blogpost additions

This commit is contained in:
Fredric N 2010-10-02 00:34:20 +02:00
parent 44d528d0d3
commit ae6bb5be78
3 changed files with 43 additions and 7 deletions

View file

@ -1,6 +1,6 @@
<?php
class BlogPost
class BlogPost extends Fiktiv_Model_Abstract
{
protected $_id;
protected $_title;
@ -9,6 +9,31 @@ class BlogPost
protected $_pubDate;
protected $_isPublished = false;
public function __construct(array $data = array())
{
$this->setAttribs($data);
}
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 getId()
{