Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixes php5.3 defines `~` for default empty `_parent` property

  • Loading branch information...
commit 10eae2f254eb0105d72697346929ba984b1ae0b8 1 parent a36ec87
Julien Muetton authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  Transformer/ModelToElasticaAutoTransformer.php
2  Transformer/ModelToElasticaAutoTransformer.php
View
@@ -45,7 +45,7 @@ public function transform($object, array $fields)
$document = new \Elastica_Document($identifier);
foreach ($fields as $key => $mapping) {
$property = new PropertyPath($key);
- if (!empty($mapping['_parent'])) {
+ if (!empty($mapping['_parent']) && $mapping['_parent'] !== '~') {
$parent = $property->getValue($object);
$identifierProperty = new PropertyPath($mapping['_parent']['identifier']);
$document->setParent($identifierProperty->getValue($parent));
Please sign in to comment.
Something went wrong with that request. Please try again.