public function findOneByName($name)
    {
        $qb = $this->createQueryBuilder();
        $qb->andWhere($qb->getRootAliases()[0] . '.name = ' . $this->addNamedParameter('name', $name, $qb));
        $result = $qb->getQuery()->getOneOrNullResult();
        return $result;
    }