/** * Get ids of products which are completes and in channel * * @return array */ protected function getIds() { if (!is_object($this->channel)) { $this->channel = $this->channelManager->getChannelByCode($this->channel); } if ($this->missingCompleteness) { $this->completenessManager->generateMissingForChannel($this->channel); } $this->query = $this->repository->buildByChannelAndCompleteness($this->channel); $rootAlias = current($this->query->getRootAliases()); $rootIdExpr = sprintf('%s.id', $rootAlias); $from = current($this->query->getDQLPart('from')); $this->query->select($rootIdExpr)->resetDQLPart('from')->from($from->getFrom(), $from->getAlias(), $rootIdExpr)->groupBy($rootIdExpr); $results = $this->query->getQuery()->getArrayResult(); return array_keys($results); }
/** * Get ids of products which are completes and in channel * * @return array */ protected function getIds() { if (!is_object($this->channel)) { $this->channel = $this->channelManager->getChannelByCode($this->channel); } if ($this->missingCompleteness) { $this->completenessManager->generateMissingForChannel($this->channel); } $this->query = $this->DnDBuildByChannelAndCompleteness($this->channel, $this->getIsComplete()); $rootAlias = current($this->query->getRootAliases()); $rootIdExpr = sprintf('%s.id', $rootAlias); $from = current($this->query->getDQLPart('from')); $this->query->select($rootIdExpr)->resetDQLPart('from')->from($from->getFrom(), $from->getAlias(), $rootIdExpr)->andWhere($this->query->expr()->orX($this->query->expr()->gte($from->getAlias() . '.updated', ':updated')))->setParameter('updated', $this->getDateFilter())->setParameter('enabled', $this->getIsEnabled())->groupBy($rootIdExpr); $results = $this->query->getQuery()->getArrayResult(); return array_keys($results); }