title: How can I create a custom DataGrid filter in SonataAdmin
body: <p>I have an entity Transaction with numerous status codes. 
  I want the user to be able to see these status codes as strings in SonataAdmin. The user should also be able to filter on the basis of these status codes. </p>
  
  <pre class="lang-php prettyprint-override"><code>Entity Transaction 
  {
      const TRANSACTION_STATUS_WAITING = 1;
      const TRANSACTION_STATUS_PENDING = 2;
      const TRANSACTION_STATUS_CONFIRMED = 3;
  
     /**
       * Set status
       *
       * @param smallint $status
       */
      public function setStatus($status)
      {
          $this-&gt;status = $status;
      }
  
      /**
       * Get status
       *
       * @return smallint 
       */
      public function getStatus()
      {
          return $this-&gt;status;
      }
  
      public function getStatusAsString()
      {
          switch($this-&gt;status){
              case(self::TRANSACTION_STATUS_WAITING): return "Waiting for Merchant";
              case(self::TRANSACTION_STATUS_PENDING): return "Pending Confirmation";
              case(self::TRANSACTION_STATUS_CONFIRMED): return "Confirmed";
          }
      }
  }
  </code></pre>
  
  <p>I have configured my Sonata List Mapper like this: </p>
  
  <pre class="lang-php prettyprint-override"><code>protected function configureListFields(ListMapper $listMapper)
  {
      $listMapper
          -&gt;addIdentifier('id')
          -&gt;add('statusAsString', null, array('sortable' =&gt; true, 'label' =&gt; 'Status'))
  }
  </code></pre>
  
  <p>which works perfectly fine: </p>
  
  <p>However I am unable to use the same as a Filter. </p>
  
  <p>If I try this:</p>
  
  <pre class="lang-php prettyprint-override"><code>protected function configureDatagridFilters(DatagridMapper $datagridMapper)
  {
      $datagridMapper
          -&gt;add('user')
          -&gt;add('status') // Works well 
          -&gt;add('statusAsString', null, array('label' =&gt; 'Status')) // Doesn't work: 
      ;
  }
  </code></pre>
  
  <p>This doesn't work. It gives the following error -> </p>
  
  <pre><code>Notice: Undefined index: statusAsString in ..../Sonata\DoctrineORMAdminBundle\Guesser\FilterTypeGuesser.php 
  </code></pre>
  
  <p>How can I make it work?</p>