parameters:
app.event_listener.request_listener.class: AppBundle\EventListener\RequestListener
app.event_listener.request_listener:
class: %app.event_listener.request_listener.class%
$result = $client->registerOrder($orderId, $orderAmount, $returnUrl, [
'orderBundle' => [
'cartItems' => [],
]
]);
<?php
namespace AppBundle\Repository;
use Doctrine\ORM\EntityManagerInterface;
class NewsFinder
{
private $entityManager;
public function __construct(EntityManagerInterface $entityManager)
{
$this->entityManager = $entityManager;
}
public function find(Request $request)
{
$queryBuilder = $this->entityManager->createQueryBuilder();
// Дальше уже логика построения запроса с помощью API QueryBuilder
// см. http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/query-builder.html
return $queryBuilder->getQuery()->getResult();
}
}