doctrine/collections — pull request #27 by mnapoli (2014-05-22 08:40:18+00:00)
Title: DDC-3016 Support using embeddables in criterias with ArrayCollection

Fix for: [DDC-3016 - Criterias do not work with embeddables when matching in memory](http://www.doctrine-project.org/jira/browse/DDC-3016).

---

When using criterias and doing the matching on a collection already loaded in memory, it will not work if filtering on embeddable objects.

Example:

```php
$criteria = new Criteria();
$criteria->andWhere($criteria->expr()->eq('actions.view', true));

$authorizations = $this->authorizations->matching($criteria);
```

Here the ClosureExpressionVisitor will try to get the property named `->actions.view` instead of `->actions->view`.

```
PHPUnit_Framework_Error_Notice : Undefined property: Tests\...\Model\ArticleAuthorization::$actions.view
```

Criterias in PersistentCollection work perfectly with embeddables, so it makes sense to have ArrayCollection also support it (else there's a mismatch between both implementations).