Domain\Repository\RobotRepository as RepositoryInterface; class RobotRepository extends EntityRepository implements RepositoryInterface { public function get(Id $id) { return $this->findOneBy(['id' => $id]); } public function add(Robot $robot) { $this->_em->persist($robot); $this->_em->flush($robot); } }
Email($username)]); if (null === $mechanic) { throw new UsernameNotFoundException( 'User does not exist.' ); } return MechanicAccount::fromMechanic($mechanic); }