Yii Framework Forum: Dealing With 2 Related Emongodocument ( Yiimongodbsuite ) - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Dealing With 2 Related Emongodocument ( Yiimongodbsuite ) 2 related Emongodocument. How to save?. How to implement $criteri Rate Topic: -----

#1 User is offline   rigel 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 19
  • Joined: 26-October 12

Posted 27 October 2012 - 08:51 AM

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
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users