/** * Check if user with given login exists * * @param string $login * @param integer $cacheMinutes * @throws InvalidArgumentException * @return boolean */ public function isLoginExists($login, $cacheMinutes = 0, $cacheTag = null) { if (empty($login)) { throw new InvalidArgumentException("\$login have to be non empty string"); } $filter = new UsersFilter(); $filter->setLogin($login); $usersCount = $this->getUsersListCount($filter, $cacheMinutes, $cacheTag); if ($usersCount > 0) { return true; } return false; }