doctrine/doctrine2 — pull request #1000 by giosh94mhz (2014-04-04 10:29:59+00:00)
Title: [DDC-3068] EntityManager::find accept array of object as id

Pull Request for ticket http://www.doctrine-project.org/jira/browse/DDC-3068
Here follow the ticket description for you convenience.

According to the documentation, ``EntityManager::find`` should return one entity given it's primary key. When a primary key of an entity is composed of multiple associations, one (me :)) would expect that the following works, but it doesn't:
```php
$entity = $_em->find('My\EntityClass', array(
'assoc1' => $instance1,
'assoc2' => $instance2
));
PHP Fatal error: Object of class My\EntityClass could not be converted to string
```
The only working way I've found is the following:
```php
$entity = $_em->find('My\EntityClass', array(
'assoc1' => $instance1->getId(),
'assoc2' => $instance2->getId()
));
```
I think that this second scenario is not correct, since expose implementation details.