Record count in an unrelated model
I want to do a record count from within a controller, but the problem
is that the models are not related.
The code:
$this->set(
'inbox_count',
$this->Email->find(
'count',
array(
'conditions' => array('to_user_id' => $this->Session-
>read('Auth.User.id'))
)
)
);
... gives an error:
Notice (8): Undefined property: CategoriesController::$Email [APP
\controllers\categories_controller.php, line 11]
Is there a way around this?
Thanks.
--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home