title: how to sort an entity's arrayCollection in symfony2
body: <p>I have an entity "container" with this property</p>
  
  <pre><code>/**
   * @ORM\OneToMany(targetEntity="BizTV\ContentManagementBundle\Entity\Content", mappedBy="container")
   */
  private $content;
  </code></pre>
  
  <p>the property is an array collection...</p>
  
  <pre><code>public function __construct() {
      $this-&gt;content = new \Doctrine\Common\Collections\ArrayCollection();
  }
  </code></pre>
  
  <p>...with these two standard methods</p>
  
  <pre><code>/**
   * Add content
   *
   * @param BizTV\ContentManagementBundle\Entity\Content $content
   */
  public function addContent(\BizTV\ContentManagementBundle\Entity\Content $content)
  {
      $this-&gt;content[] = $content;
  }
  
  /**
   * Get content
   *
   * @return Doctrine\Common\Collections\Collection 
   */
  public function getContent()
  {
      return $this-&gt;content;
  }
  </code></pre>
  
  <p>Now my question is, is there a smooth way to build a sorting feature into this, perhaps on the getContent() call? I am no php wiz and certainly not seasoned in symfony2 but I learn as I go.</p>
  
  <p>The content entity itself has a sorting INT like this that I want to sort it on:</p>
  
  <pre><code>/**
   * @var integer $sortOrder
   *
   * @ORM\Column(name="sort_order", type="integer")
   */
  private $sortOrder; 
  </code></pre>