Skip to content

Commit

Permalink
fixes php5.3 defines ~ for default empty _parent property
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien Muetton committed Nov 26, 2012
1 parent a36ec87 commit 10eae2f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Transformer/ModelToElasticaAutoTransformer.php
Expand Up @@ -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));
Expand Down

0 comments on commit 10eae2f

Please sign in to comment.