How to reference the instantiating class

thundercow

New Member
Currently I have my controller instantiating a model class. Every time I create this class I need to set the logged in user's info in the model. I feel like there is a more elegant way of doing this, but I'm not sure how to do it :-( Here is an example of the code: \[code\]$leadModel = new Application_Model_DbTable_Leads;$leadModel->user = $this->user;\[/code\]What I would like to do from inside the model I'm creating is access the user using something like this (I know this only applies to classes that are extending other classes):\[code\]$user_id = $this::parent->user;\[/code\]Thanks so much!
 
Back
Top