From a58bc8d07f1d4b209ed6ae43430e4c0907583c36 Mon Sep 17 00:00:00 2001 From: user323 Date: Wed, 27 Mar 2019 09:26:47 +0700 Subject: [PATCH] Fix error entity embeddables --- Grid/Source/Entity.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Grid/Source/Entity.php b/Grid/Source/Entity.php index 78cc0f99..fcb40b35 100644 --- a/Grid/Source/Entity.php +++ b/Grid/Source/Entity.php @@ -17,11 +17,12 @@ use APY\DataGridBundle\Grid\Column\JoinColumn; use APY\DataGridBundle\Grid\Row; use APY\DataGridBundle\Grid\Rows; +use Doctrine\ORM\Mapping\ReflectionEmbeddedProperty; use Doctrine\ORM\NoResultException; use Doctrine\ORM\Query; -use Doctrine\ORM\QueryBuilder; use Doctrine\ORM\Query\Expr\Join; use Doctrine\ORM\Query\ResultSetMapping; +use Doctrine\ORM\QueryBuilder; use Doctrine\ORM\Tools\Pagination\CountWalker; use Doctrine\ORM\Tools\Pagination\Paginator; use Symfony\Component\HttpKernel\Kernel; @@ -202,6 +203,13 @@ protected function getFieldName($column, $withAlias = false) return $column->getField(); } + $reflectionFields = $this->ormMetadata->getReflectionProperties(); + $reflectionProperty = (isset($reflFields[$name])) ? $reflectionFields[$name] : null; + + if ($reflectionProperty instanceof ReflectionEmbeddedProperty) { + return $this->getTableAlias() . '.' . $name; + } + if (strpos($name, '.') !== false) { $previousParent = '';