for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of AppName.
*
* (c) Monofony
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Repository;
use Sylius\Bundle\UserBundle\Doctrine\ORM\UserRepository as BaseUserRepository;
use Sylius\Component\User\Model\UserInterface;
use Sylius\Component\User\Repository\UserRepositoryInterface;
class UserRepository extends BaseUserRepository implements UserRepositoryInterface
{
/**
* {@inheritdoc}
public function findOneByEmail(string $email): ?UserInterface
return $this->createQueryBuilder('o')
->innerJoin('o.customer', 'customer')
->andWhere('customer.emailCanonical = :email')
->setParameter('email', $email)
->getQuery()
->getOneOrNullResult()
;
}