Piwik\Plugins\UsersManager\Model::userEmailExists PHP Method

userEmailExists() public method

public userEmailExists ( $userEmail )
    public function userEmailExists($userEmail)
    {
        $db = $this->getDb();
        $count = $db->fetchOne("SELECT count(*) FROM " . $this->table . " WHERE email = ?", $userEmail);
        return $count != 0;
    }

Usage Example

Example #1
0
 /**
  * Returns true if user with given email (userEmail) is known in the database, or the Super User
  *
  * @param string $userEmail
  * @return bool true if the user is known
  */
 public function userEmailExists($userEmail)
 {
     Piwik::checkUserIsNotAnonymous();
     return $this->model->userEmailExists($userEmail);
 }