how to sort an entity's arrayCollection in symfony2
问题 I have an entity "container" with this property /** * @ORM\OneToMany(targetEntity="BizTV\ContentManagementBundle\Entity\Content", mappedBy="container") */ private $content; the property is an array collection... public function __construct() { $this->content = new \Doctrine\Common\Collections\ArrayCollection(); } ...with these two standard methods /** * Add content * * @param BizTV\ContentManagementBundle\Entity\Content $content */ public function addContent(\BizTV\ContentManagementBundle