/** * Returns true if user has at least one email account to send emails from. * * @access public * @return boolean */ function hasEmailAccounts() { $accounts = MailAccountUsers::find(array('conditions' => '`user_id` = ' . $this->getId())); return is_array($accounts) && count($accounts) > 0; }