2 EMongoDocument link and access

36 views
Skip to first unread message

Rigel

unread,
Oct 27, 2012, 9:52:33 AM10/27/12
to yiimong...@googlegroups.com
I have 2 Models in in application advertisement and user. None of them is EMongoEmbeddedDocument.They look like this.
class advertisement extends EMongoDocument
{
$adv_date
$adv_user /*This is another EMongoDocument */
public function embeddedDocuments()
{ return array('adv_user' => 'user',);}
}
class User extends EMongoDocument
{ $username }

Following are the problems I am facing.
1. If I have user objectid after creating user. How can I link this user to any advertisment.
Didnt work


2. How to access primary object id of user from advertisement table in criteria
$Criteria=new EMongoCriteria();
$Criteria->adv_user->_id='508bdbb045d9453c25000005';

doesn't work
I am new 
Reply all
Reply to author
Forward
0 new messages