php - Join AR models without relations() methods in YII -


I'm new to yii and php frameworks in the world Im Many more relationships (for relationships) Is trying to make many with me? I am thinking that it would be possible to join the AR model without using relationships () methods? Should I write a getAnotherARModel method with a simple query in it, which comes back with the model? (Sorry for my bad english)

I think I was not so clear, and I Not explained that I am trying to do this. I can not use relationship methods due to my database structure There is no direct connection between my tables (the key of the connection is not stored in one of the tables). I sorted out the problem by writing a simple method that came back with the searched AR object. Here's my method:

  public function getPubData ($ key) {return PubData :: model () - & gt; FindByPk (array ('key' = & gt; $ key)); }  

And after that you can access this object in this way:

  $ publicData = $ model- & gt; GetPubData ($ key);  

The only reason is that you are creating many people to join many, only the difference is the query.


Comments