Skip to content

Instantly share code, notes, and snippets.

@tristanlins
Last active December 20, 2015 22:19
Show Gist options
  • Save tristanlins/6204381 to your computer and use it in GitHub Desktop.
Save tristanlins/6204381 to your computer and use it in GitHub Desktop.
[Avisota 2 Example] search for recipients
<?php
// access the entity manager and get the recipient repository
/** @var \Contao\Doctrine\ORM\EntityHelper $entityManager */
$entityManager = EntityHelper::getEntityManager();
$repository = $entityManager->getRepository('Avisota\Contao:Recipient');
// search recipient by email
/** @var \Avisota\Contao\Entity\Recipient $recipient */
$recipient = $repository->findOneBy(array('email' => 'me@example.com'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment