Log in


(no subject)

« previous entry | next entry »
Dec. 21st, 2006 | 06:42 pm
posted by: sevka in cakephp

I have model A and model B. Can I use model B inside the model A class?

Link | Leave a comment | Share

Comments {4}

Allan Smithee

(no subject)

from: bobalien
date: Dec. 21st, 2006 05:14 pm (UTC)

If they are associated, I believe so:

Let's say you have:

class A extends AppModel{
var $belongsTo = 'B';

I THINK you can say $this->B->find() within the A class, but I could be wrong. This method probably isn't "best practices" either. Let me know if that works, I might be wrong.

Reply | Thread


(no subject)

from: sevka
date: Dec. 26th, 2006 01:16 pm (UTC)

it works!
thanks )

Reply | Parent | Thread