Created
April 30, 2015 21:45
-
-
Save AhmedSamy/795bcf2be02c43cb4a01 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @MongoDB\PreFlush | |
* @return ArrayCollection | |
*/ | |
public function orderSteps() | |
{ | |
//workaround to sort steps collection | |
$iterator = $this->steps->getIterator(); | |
$iterator->uasort( | |
function ($a, $b) { | |
return ($a->getOrder() < $b->getOrder()) ? -1 : 1; | |
} | |
); | |
$this->steps = new ArrayCollection(iterator_to_array($iterator)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment