getScalarResult example

$productFeedRepository = $this->container->get(ModelManager::class)->getRepository(ProductFeed::class);
            $queryBuilder = $productFeedRepository->createQueryBuilder('feed');

            if (!empty($context->getCurrentWord())) {
                $queryBuilder->andWhere($queryBuilder->expr()->like('feed.id', ':id'))
                    ->setParameter('id', addcslashes($context->getCurrentWord(), '%_') . '%');
            }

            $result = $queryBuilder->select(['feed.id'])
                ->addOrderBy($queryBuilder->expr()->asc('feed.id'))
                ->getQuery()
                ->getScalarResult();

            return array_column($result, 'id');
        }

        return [];
    }

    /** * {@inheritdoc} */
    public function completeArgumentValues($argumentName, CompletionContext $context)
    {
Home | Imprint | This part of the site doesn't use cookies.