Deprecated: Return type of Google\Model::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/sanralsmme/vendor/google/apiclient/src/Model.php on line 256

Deprecated: Return type of Google\Model::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/sanralsmme/vendor/google/apiclient/src/Model.php on line 261

Deprecated: Return type of Google\Model::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/sanralsmme/vendor/google/apiclient/src/Model.php on line 268

Deprecated: Return type of Google\Model::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/sanralsmme/vendor/google/apiclient/src/Model.php on line 278

Deprecated: Return type of Google\Collection::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/sanralsmme/vendor/google/apiclient/src/Collection.php on line 22

Deprecated: Return type of Google\Collection::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/sanralsmme/vendor/google/apiclient/src/Collection.php on line 38

Deprecated: Return type of Google\Collection::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/sanralsmme/vendor/google/apiclient/src/Collection.php on line 30

Deprecated: Return type of Google\Collection::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/sanralsmme/vendor/google/apiclient/src/Collection.php on line 43

Deprecated: Return type of Google\Collection::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/sanralsmme/vendor/google/apiclient/src/Collection.php on line 14

Deprecated: Return type of Google\Collection::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/sanralsmme/vendor/google/apiclient/src/Collection.php on line 49
Symfony Profiler

src/Repository/BlogRepository.php line 50

Open in your IDE?
  1. <?php
  2. namespace App\Repository;
  3. use App\Entity\Blog;
  4. use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
  5. use Doctrine\Persistence\ManagerRegistry;
  6. use Symfony\Component\HttpFoundation\Request;
  7. /**
  8.  * @method Blog|null find($id, $lockMode = null, $lockVersion = null)
  9.  * @method Blog|null findOneBy(array $criteria, array $orderBy = null)
  10.  * @method Blog[]    findAll()
  11.  * @method Blog[]    findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
  12.  */
  13. class BlogRepository extends ServiceEntityRepository
  14. {
  15.     public function __construct(ManagerRegistry $registry)
  16.     {
  17.         parent::__construct($registryBlog::class);
  18.     }
  19.     /**
  20.      * @return Blog[] Returns an array of Publications objects
  21.      */
  22.     public function findBlogs()
  23.     {
  24.         $now = new \DateTime();
  25.         return $this->createQueryBuilder('b')
  26.             ->andWhere('b.isPublished = :published')
  27.             ->setParameter('published'1)
  28.             ->andWhere('b.displayDate <= :today')
  29.             ->setParameter('today'$now)
  30.             ->orderBy('b.displayDate''ASC')
  31.             ->getQuery()
  32.             ->getResult()
  33.             ;
  34.     }
  35.     /**
  36.      * @return Blog[] Returns an array of Publications objects
  37.      */
  38.     public function findBlogArticle($blog_id)
  39.     {
  40.         return $this->createQueryBuilder('b')
  41.             ->andWhere('b.id = :id')
  42.             ->setParameter('id'$blog_id)
  43.             ->getQuery()
  44.             ->getResult()
  45.             ;
  46.     }
  47.     /*
  48.     public function findOneBySomeField($value): ?Blog
  49.     {
  50.         return $this->createQueryBuilder('b')
  51.             ->andWhere('b.exampleField = :val')
  52.             ->setParameter('val', $value)
  53.             ->getQuery()
  54.             ->getOneOrNullResult()
  55.         ;
  56.     }
  57.     */
  58. }