|
11 | 11 | use Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException; |
12 | 12 | use Ibexa\Contracts\Core\Repository\LanguageService; |
13 | 13 | use Ibexa\Contracts\Core\Repository\Repository; |
| 14 | +use Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo; |
14 | 15 | use Ibexa\Contracts\Core\Repository\Values\Content\Language; |
15 | 16 | use Netgen\Bundle\IbexaScheduledVisibilityBundle\Core\Configuration; |
16 | 17 | use Netgen\Bundle\IbexaScheduledVisibilityBundle\Core\Exception\InvalidStateException; |
|
30 | 31 |
|
31 | 32 | use function count; |
32 | 33 | use function sprintf; |
| 34 | +use function time; |
33 | 35 |
|
34 | 36 | final class ScheduledVisibilityUpdateCommand extends Command |
35 | 37 | { |
@@ -205,8 +207,10 @@ private function getQueryBuilder(?int $since, array $contentTypeIds): QueryBuild |
205 | 207 | ->select('id', 'initial_language_id') |
206 | 208 | ->from('ezcontentobject') |
207 | 209 | ->where('published != :unpublished') |
| 210 | + ->andWhere('status != :trashed') |
208 | 211 | ->orderBy('id', 'ASC') |
209 | | - ->setParameter('unpublished', 0); |
| 212 | + ->setParameter('unpublished', 0) |
| 213 | + ->setParameter('trashed', ContentInfo::STATUS_TRASHED); |
210 | 214 |
|
211 | 215 | $this->applySince($queryBuilder, $since); |
212 | 216 | $this->applyContentTypes($queryBuilder, $contentTypeIds); |
@@ -254,6 +258,7 @@ private function getPager(?int $since): Pagerfanta |
254 | 258 | ->from('ezcontentobject') |
255 | 259 | ->where('published != :unpublished') |
256 | 260 | ->setParameter('unpublished', 0) |
| 261 | + ->setParameter('trashed', ContentInfo::STATUS_TRASHED) |
257 | 262 | ->setMaxResults(1); |
258 | 263 |
|
259 | 264 | $this->applySince($queryBuilder, $since); |
|
0 commit comments