Transformer/AbstractElasticaToModelTransformer.php 1 location
|
@@ 47-49 (lines=3) @@
|
| 44 |
|
{ |
| 45 |
|
$propertyAccessor = $this->propertyAccessor; |
| 46 |
|
|
| 47 |
|
return function ($a, $b) use ($idPos, $identifierPath, $propertyAccessor) { |
| 48 |
|
return $idPos[(string) $propertyAccessor->getValue($a, $identifierPath)] > $idPos[(string) $propertyAccessor->getValue($b, $identifierPath)]; |
| 49 |
|
}; |
| 50 |
|
} |
| 51 |
|
} |
| 52 |
|
|
Doctrine/AbstractElasticaToModelTransformer.php 1 location
|
@@ 104-107 (lines=4) @@
|
| 101 |
|
|
| 102 |
|
// sort objects in the order of ids |
| 103 |
|
$idPos = array_flip($ids); |
| 104 |
|
usort($objects, function($a, $b) use ($idPos, $identifier, $propertyAccessor) |
| 105 |
|
{ |
| 106 |
|
return $idPos[(string) $propertyAccessor->getValue($a, $identifier)] > $idPos[(string) $propertyAccessor->getValue($b, $identifier)]; |
| 107 |
|
}); |
| 108 |
|
|
| 109 |
|
return $objects; |
| 110 |
|
} |