Skip to content
Snippets Groups Projects
Select Git revision
  • bf393784e08a9b0c5fc7eb319e9053a3cf3232ff
  • master default
2 results

models.py

Blame
  • TeamRepository.php 674 B
    <?php
    /**
     * Created by PhpStorm.
     * User: jeremyguiselin
     * Date: 05/12/2016
     * Time: 13:01
     */
    
    namespace BackendBundle\Repository;
    
    use BackendBundle\Entity\Team;
    use Doctrine\ORM\EntityRepository;
    
    /**
     * TeamRepository
     *
     * This class was generated by the Doctrine ORM. Add your own custom
     * repository methods below.
     */
    
    class TeamRepository extends EntityRepository
    {
        public function getAll()
        {
            $qb = $this->createQueryBuilder('t');
            $qb->select('t');
    
            return $qb;
    
        }
    
        public function alreadyExists(Team $pack) : bool
        {
            return $this->findOneBy([
                'name' => $pack->getName()
            ]) !== null;
        }
    }