title: Call function in another class Symfony2
body: <p>I have a function that I need a few controllers. Can i call it in some other way than to extend the class in which the function is? 
  Question:</p>
  
  <pre><code>class CategoryController extends Controller
  {
      public function getCategoriesAction()
      {
          $categories = $this-&gt;getDoctrine()-&gt;getRepository('ModelBundle:Category')-&gt;findAll();
          return $categories;
      }
  }
  </code></pre>
  
  <p>How call this function in PostController?</p>