UserMapper.php 508 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
<?php

namespace UnicaenAuth\Service;

use UnicaenAuth\Entity\Db\User;
use ZfcUserDoctrineORM\Mapper\User as ZfcUserDoctrineORMUserMapper;

class UserMapper extends ZfcUserDoctrineORMUserMapper
{
    /**
     * @param string $token
     * @return User
     */
    public function findOneByPasswordResetToken($token)
    {
        /** @var User $user */
        $user = $this->em->getRepository($this->options->getUserEntityClass())->findOneBy(['passwordResetToken' => $token]);

        return $user;
    }
}