Order of Symfony form CollectionType field
问题 In my model I have a Recipe entity and Ingredient entity. In Recipe entity, the relation is defined like this: /** * @ORM\OneToMany(targetEntity="Ingredient", mappedBy="recipe", cascade={"remove", "persist"}, orphanRemoval=true) * @ORM\OrderBy({"priority" = "ASC"}) */ private $ingredients; In Ingredient entity: /** * @ORM\ManyToOne(targetEntity="Recipe", inversedBy="ingredients") * @ORM\JoinColumn(name="recipe_id", referencedColumnName="id") */ private $recipe; I am working on CRUD controller