Skip to content

Instantly share code, notes, and snippets.

@jwage
Created December 6, 2010 18:43
Show Gist options
  • Save jwage/730715 to your computer and use it in GitHub Desktop.
Save jwage/730715 to your computer and use it in GitHub Desktop.

1.) find() is only for finding by identifier now

	$article = $dm->find('Article', array('title' => 'test'))

to

	$article = $dm->getRepository('Article')->findBy(array('title' => 'test'));

2.) Query builder change:

	$qb = $dm->createQueryBuilder('Article');
	$query = $qb->getQuery();
	$articles = $query->execute();

Or you can do:

	foreach ($query as $article) {
	    //
	}

3.) Ids

We no longer have:

/** @Id(custom=true) */

But we have id generation strategies:

	/** @Id(strategy="uuid") */

4.) No more options on query execution. Instead you can specify the options on getQuery():

	$query = $qb->getQuery(array('safe' => true))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment