Not signed in (Sign In)
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    • CommentAuthorJCC
    • CommentTimeJun 27th 2008
     
    Hi,

    I have a model A that has a many-to-one relationship with model B.

    So model A has the class variable "var $belongs_to = array("b");" and I can access the object B via object A. But only the row associated in B to A.
    The B available in A is an instance of AkAssociatedRecord where I need functionality of AkActiveRecord/ActiveRecord (for findFirst).

    What I would like to be able to do is do a findFirst("code = ?", $code) on B to retrieve a "default" B. When the object A is first created it must point to a default B and not be NULL.

    Is there a way I can achieve this?

    Kind regards,

    John
  1.  

    maybe with AK::import('modelname');

    • CommentAuthorJCC
    • CommentTimeJul 2nd 2008
     
    Thanks Julio, that seems to be what I was looking for!

    John
    • CommentAuthorManoj
    • CommentTimeFeb 9th 2010
     
    Thanks Julio
Add your comments
    Username Password
  • Format comments as