src/Entity/Recipe.php
public function getOrderedIngredients(): Collection
    {
        return $this->ingredients->matching(Criteria::create()->orderBy(['order' => Criteria::ASC]));
    }
public function getOrderedIngredients(): Collection
    {
        return $this->ingredients->matching(Criteria::create()->orderBy(['order' => Criteria::ASC]));
    }
public function getOrderedIngredients ( ) : Collection { return $ this -> ingredients -> matching ( Criteria :: create ( ) -> orderBy ( [ 'order' => Criteria :: ASC ] ) ) ; }
Returns the ordered ingredients of the recipe, in case the ingredients are not already ordered.
@return Collection|RecipeIngredient[]
Returns the ordered ingredients of the recipe in case the ingredients are not already ordered .