I am using cakephp 2.0 and I a have a shell that sends me a daily email for each account that has a message. I now want it to only send me an email for that account if it has 5 messages or more. How do I do this? My current code (which isn't working) is this:
$items = $this->ReportLog->find('all', array(
'conditions' => array(
'account' => 'msg' > 5
)));
foreach($items as $item)
{
$message = 'Account Name: '. $item['ReportLog']['account'] . "
" . 'Message: '. $item['ReportLog']['msg'];
$this->ReportLog->sendMail($message, 'me@myEmail.com');
}
This shell works just fine without the conditions so I know there is something wrong with that. Thanks for any help.