Skip to content

Instantly share code, notes, and snippets.

@assembledadam
Last active December 19, 2015 20:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save assembledadam/6011197 to your computer and use it in GitHub Desktop.
Save assembledadam/6011197 to your computer and use it in GitHub Desktop.
// get the ID (integer) of the site I want
$site = $em->createQuery('SELECT s.id FROM Entity\Site s WHERE s.name = ?1')->setParameter(1, 'My Site')->getResult();
// get the site reference based on the ID
$obj->setJoiningSite($em->getReference('Entity\Site', $site[0]['id']));`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment