@@ 176-180 (lines=5) @@ | ||
173 | ||
174 | // NEW |
|
175 | $metadatas = $em->getClassMetadata(get_class($currentEntity)); |
|
176 | foreach ($metadatas->fieldMappings as $fieldName => $field) { |
|
177 | if (strpos($query, ':'.$fieldName) !== false) { |
|
178 | $itemsQueryBuilder->setParameter($fieldName, $metadatas->getFieldValue($currentEntity, $fieldName)); |
|
179 | } |
|
180 | } |
|
181 | foreach ($metadatas->associationMappings as $fieldName => $field) { |
|
182 | if (strpos($query, ':'.$fieldName) !== false) { |
|
183 | $itemsQueryBuilder->setParameter($fieldName, $metadatas->getFieldValue($currentEntity, $fieldName)->getId()); |
|
@@ 181-185 (lines=5) @@ | ||
178 | $itemsQueryBuilder->setParameter($fieldName, $metadatas->getFieldValue($currentEntity, $fieldName)); |
|
179 | } |
|
180 | } |
|
181 | foreach ($metadatas->associationMappings as $fieldName => $field) { |
|
182 | if (strpos($query, ':'.$fieldName) !== false) { |
|
183 | $itemsQueryBuilder->setParameter($fieldName, $metadatas->getFieldValue($currentEntity, $fieldName)->getId()); |
|
184 | } |
|
185 | } |
|
186 | ||
187 | if (strpos($query, ':currentEntity') !== false) { |
|
188 | $itemsQueryBuilder->setParameter('currentEntity', $currentEntity->getId()); |