title: Doctrine filters for order by sentence
body: <p>Is there something similar to <a href="http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/filters.html" rel="nofollow noreferrer">doctrine filters</a> which allows to add order by sentences to any outcoming query? I need to append the order by sentence to all the database queries performed under any request with method get.</p>
  <p>Update: Take in consideration I never know the sort criteria, that's up to the user, so defining @OrderBy annotation solves the problem partially.</p>
  <p>Update2: Perhaps it is possible to achieve this by modifying the ClassMetadata param in the filter body, just I cant realize which property does the job</p>
  <pre><code>class FilterTenant extends SQLFilter {
  
      protected $reader;
      protected $userGroups;
      protected $user;
  
      /**
       * Gets the SQL query part to add to a query.
       *
       * @param ClassMetaData $targetEntity
       * @param string $targetTableAlias
       *
       * @return string The constraint SQL if there is available, empty string otherwise.
       */
      public function addFilterConstraint(ClassMetadata $targetEntity, $targetTableAlias)
      {
          if (empty($this-&gt;reader)) {
              return '';
          }
          $DeletedMarkerAnn = $this-&gt;reader-&gt;getClassAnnotation(
              $targetEntity-&gt;getReflectionClass(),
              'AplicacionBaseBundle\\Filters\\Tenant'
          );
  
          if (!$DeletedMarkerAnn) {
              return '';
          }
  
      //$targetEntity-&gt;what?
      }
  
      public function setAnnotationReader(Reader $reader)
      {
          $this-&gt;reader = $reader;
      }
  }
  </code></pre>