| @@ 31-38 (lines=8) @@ | ||
| 28 | $this->qb = $this->getInstance(); |
|
| 29 | ||
| 30 | //If $excludeUnpublished === true, we exclude the non published results |
|
| 31 | if ($excludeUnpublished) { |
|
| 32 | $this->qb |
|
| 33 | ->andWhere('article.status = :status') |
|
| 34 | ->orWhere('article.status = :scheduled_status AND article.publishedAt > :publicationDate') |
|
| 35 | ->setParameter('status', PageStatus::PUBLISHED) |
|
| 36 | ->setParameter('scheduled_status', PageStatus::SCHEDULED) |
|
| 37 | ->setParameter('publicationDate', new \DateTime()); |
|
| 38 | } |
|
| 39 | ||
| 40 | return $this; |
|
| 41 | } |
|
| @@ 72-79 (lines=8) @@ | ||
| 69 | $this->queryBuilder = $this->getInstance(); |
|
| 70 | ||
| 71 | //If $excludeUnpublished === true, we exclude the non published results |
|
| 72 | if ($excludeUnpublished) { |
|
| 73 | $this->queryBuilder |
|
| 74 | ->andWhere('page.status = :status') |
|
| 75 | ->orWhere('page.status = :scheduled_status AND page.publishedAt > :publicationDate') |
|
| 76 | ->setParameter('status', PageStatus::PUBLISHED) |
|
| 77 | ->setParameter('scheduled_status', PageStatus::SCHEDULED) |
|
| 78 | ->setParameter('publicationDate', new \DateTime()); |
|
| 79 | } |
|
| 80 | ||
| 81 | return $this; |
|
| 82 | } |
|