Abhoryo/APYDataGridBundle — pull request #663 by mamamiapeguin (2014-12-19 09:20:10+00:00)
Title: fix issue #32 mongodb ODM missing support for `.` notation

Embedded/Referenced Document Data is lost at ```APY\DataGridBundle\Grid\Source\Document::execute Line205```, where the query data is put into grid row.
Supposed we have a class ```User``` has a property ```profile```, which is an embedded document, I wanna display profile property ```lastname```.
```$column->getId()``` would return ```profile.lastname```, while the ```properties``` array only has an element ```profile``` which holds the embedded document. Such an mismatch leads to skipping over the ```profile.lastname```.
So I added the logic to handle '.' notation as following:
```php
foreach ($columns as $column) {
$hierarchy = explode('.', $column->getId());
$length = count($hierarchy);
$node = $resource;
for ($i = 0; $i < $length; $i++) {
if (isset($node)) {
$node = $this->getClassProperties($node);
$node = $node[strtolower($hierarchy[$i])];
}
}
$row->setField($column->getId(), $node);
}
```
In case of annotation ```profile.lastname``` differs from actual class property ```Profile::lastName```, I had them unified in lowercase:
```php
$result[strtolower($property->getName())] = $property->getValue($obj);
```