public function isValidUser($userName, $password)
    {
        $filter = new IteratorFilter();
        $passwordGenerator = $this->getUserDefinition()->getClosureForUpdate('password');
        $filter->addRelation($this->getUserDefinition()->loginField(), Relation::EQUAL, strtolower($userName));
        $filter->addRelation(
            $this->getUserDefinition()->getPassword(),
            Relation::EQUAL,
            $passwordGenerator($password, null)
        );
        return $this->getUser($filter);
    }
public function isValidUser($userName, $password)
    {
        $filter = new IteratorFilter();
        $passwordGenerator = $this->getUserDefinition()->getClosureForUpdate('password');
        $filter->addRelation($this->getUserDefinition()->loginField(), Relation::EQUAL, strtolower($userName));
        $filter->addRelation(
            $this->getUserDefinition()->getPassword(),
            Relation::EQUAL,
            $passwordGenerator($password, null)
        );
        return $this->getUser($filter);
    }
public function isValidUser ( $ userName , $ password ) { $ filter = new IteratorFilter ( ) ; $ passwordGenerator = $ this -> getUserDefinition ( ) -> getClosureForUpdate ( 'password' ) ; $ filter -> addRelation ( $ this -> getUserDefinition ( ) -> loginField ( ) , Relation :: EQUAL , strtolower ( $ userName ) ) ; $ filter -> addRelation ( $ this -> getUserDefinition ( ) -> getPassword ( ) , Relation :: EQUAL , $ passwordGenerator ( $ password , null ) ) ; return $ this -> getUser ( $ filter ) ; }
Validate if the user and password exists in the file
Return Row if user exists; null, otherwise

@param string $userName User login
@param string $password Plain text password
@return UserModel
@throws \ByJG\Serializer\Exception\InvalidArgumentException
Validate if the user and password exists in the file Return Row if user exists ; null otherwise