getbyaccount.php 458 B

12345678910111213141516
  1. <?php
  2. /**
  3. * Get user by his account.
  4. *
  5. * @param mixed $account
  6. * @access public
  7. * @return object the user.
  8. */
  9. public function getByAccount($account)
  10. {
  11. return $this->dao->select('*')->from(TABLE_USER)
  12. ->beginIF(validater::checkEmail($account))->where('email')->eq($account)->fi()
  13. ->beginIF(!validater::checkEmail($account))->where('account')->eq($account)->fi()
  14. ->andWhere('deleted')->eq('0')
  15. ->fetch();
  16. }