We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
just how to use it?
The text was updated successfully, but these errors were encountered:
For more complex example, just look at Sylius Repositories.
https://github.com/Sylius/Sylius/blob/dcc4acd46a3b9d629bb6f7456d7d16dae738988d/src/Sylius/Bundle/CoreBundle/Doctrine/ORM/OrderRepository.php
First step:
/** @var AssociationHydrator */ protected $associationHydrator; /** * {@inheritdoc} */ public function __construct(EntityManager $entityManager, Mapping\ClassMetadata $class) { parent::__construct($entityManager, $class); $this->associationHydrator = new AssociationHydrator($entityManager, $class); }
Second step:
public function findCartForSelectingPayment($id): ?OrderInterface { /** @var OrderInterface $order */ $order = $this->createQueryBuilder('o') ->andWhere('o.id = :id') ->andWhere('o.state = :state') ->setParameter('id', $id) ->setParameter('state', OrderInterface::STATE_CART) ->getQuery() ->getOneOrNullResult() ; $this->associationHydrator->hydrateAssociations($order, [ 'items', 'items.variant', 'items.variant.product', 'items.variant.product.translations', ]); return $order; }
Sorry, something went wrong.
No branches or pull requests
just how to use it?
The text was updated successfully, but these errors were encountered: