3 class PostModel
extends ActiveMongo
10 function author_filter(&$value, $old_value)
12 if (!$value instanceof MongoID
) {
13 if (!$value InstanceOf AuthorModel
) {
14 throw new Exception("The author property must be an AuthorModel object");
16 $value = $value->getID();
20 function getCollectionName()
25 function updateAuthorInfo(MongoID
$id)
27 $author = new AuthorModel
;
32 'author_name' => $author->name
,
33 'author_username' => $author->username
,
41 $this->_getCollection()->update($filter, $document, array('multiple' => true));
48 $this->updateAuthorInfo($this->author
);
53 $collection = & $this->_getCollection();
54 $collection->ensureIndex(array('uri' => 1), array('unique'=> 1, 'background' => 1));