title: How to use IF statement that provided by DoctrineExtensions
body: <p>I'm playing with <a href="https://github.com/beberlei/DoctrineExtensions" rel="nofollow">DoctrineExtensions</a> but can not manage it. After register DoctrineExtensions, I have following line of DQL with Zend Framework:</p>
  
  <pre><code>$qb-&gt;having(new IfElse("A.type = 0", new FindInSet(1, new GroupConcat('B.id', ',')) &gt;0 , '1') );
  </code></pre>
  
  <p>But get this error msg:</p>
  
  <blockquote>
    <p>Exception information:</p>
    
    <p>Message: Expression of type 'DoctrineExtensions\Query\Mysql\IfElse'
    not allowed in this context.*</p>
  </blockquote>
  
  <p>Could you help me to point out what incorrect in my command or any document on how to use DoctrineExtensions?</p>
  
  <p>UPDATED:</p>
  
  <p>I've found a the way to implement custom function by :
  I have given it a litle try by adding this line to boostrap:</p>
  
  <pre><code>$config-&gt;addCustomStringFunction('IF', 'DoctrineExtensions\Query\Mysql\IfElse');
  </code></pre>
  
  <p>And use it in DQL as:</p>
  
  <pre><code>$qb-&gt;having("IF( A.type = 0, S.status = 0, S.status = 1 )");
  </code></pre>
  
  <p>But get this error:</p>
  
  <p>Message: [Syntax Error] line 0, col 152: Error: Expected Doctrine\ORM\Query\Lexer::T_COMMA, got '=' </p>
  
  <p>Maybe I'm wrong in syntax?</p>