src/Domain/Repository/Identity/AdministratorTokenRepository.php
public function findOneUnexpiredByKey(string $key)
    {
        $criteria = new Criteria();
        $criteria->where(Criteria::expr()->eq('key', $key))
            ->andWhere(Criteria::expr()->gt('expiry', new \DateTime()));

        $firstMatch = $this->matching($criteria)->first();

        // $firstMatch will be false if there is no match, not null.
        return $firstMatch ?: null;
    }
public function findOneUnexpiredByKey(string $key)
    {
        $criteria = new Criteria();
        $criteria->where(Criteria::expr()->eq('key', $key))
            ->andWhere(Criteria::expr()->gt('expiry', new \DateTime()));

        $firstMatch = $this->matching($criteria)->first();

        // $firstMatch will be false if there is no match, not null.
        return $firstMatch ?: null;
    }
public function findOneUnexpiredByKey ( string $ key ) { $ criteria = new Criteria ( ) ; $ criteria -> where ( Criteria :: expr ( ) -> eq ( 'key' , $ key ) ) -> andWhere ( Criteria :: expr ( ) -> gt ( 'expiry' , new \ DateTime ( ) ) ) ; $ firstMatch = $ this -> matching ( $ criteria ) -> first ( ) ; // $firstMatch will be false if there is no match, not null. return $ firstMatch ? : null ; }
Finds one unexpired token by the given key. Returns null if there is no match.

This method is intended to check for the validity of a session token.

@param string $key

@return AdministratorToken|null
Finds one unexpired token by the given key . Returns null if there is no match .