Your IP : 216.73.217.79


Current Path : /var/www/v3.cesa.co.za/src/ContentBundle/Repository/
Upload File :
Current File : /var/www/v3.cesa.co.za/src/ContentBundle/Repository/FormRepository.php

<?php

namespace App\ContentBundle\Repository;

use App\ContentBundle\Entity\Form;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;

/**
 * @extends ServiceEntityRepository<Form>
 *
 * @method Form|null find($id, $lockMode = null, $lockVersion = null)
 * @method Form|null findOneBy(array $criteria, array $orderBy = null)
 * @method Form[]    findAll()
 * @method Form[]    findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
 */
class FormRepository extends ServiceEntityRepository
{

    public function __construct(ManagerRegistry $registry)
    {
        parent::__construct($registry, Form::class);
    }

    /**
     * Get the list query
     * @return object
     */
    public function getSiteListQuery()
    {
        $qb = $this->createQueryBuilder('f')
            // ->where('f.end_date IS NULL OR f.end_date >= :now')
            // ->setParameter('now', new \DateTime())
            ->orderBy('f.title', 'ASC')
            ->getQuery();

        // echo $qb->getSQL() . '<br />';

        return $qb;
    }

    //    public function findOneBySomeField($value): ?Form
    //    {
    //        return $this->createQueryBuilder('f')
    //            ->andWhere('f.exampleField = :val')
    //            ->setParameter('val', $value)
    //            ->getQuery()
    //            ->getOneOrNullResult()
    //        ;
    //    }
}