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