title: Yii framework 2.0 ActiveRecord date not between two dates
body: <p>Working with Yii framework 2.0 I have a database table with the columns <strong><em>'from_date'</em></strong> and <strong><em>'to_date'</em></strong>. I would like to select and count all records where:</p>
  
  <ol>
  <li>today is NOT between <strong><em>from_date</em></strong> and <strong><em>to_date</em></strong>. And not even equal these dates <strong><em>(!($from_date &lt;= $today) &amp;&amp; !($today &lt;= $to_date)))</em></strong>. </li>
  </ol>
  
  <p>OR</p>
  
  <ol start="2">
  <li><strong><em>from_date</em></strong> is NULL and <strong><em>to_date</em></strong> is NULL. Because in some records these dates are empty, they need to be selected and counted as well.</li>
  </ol>
  
  <p>I have a model which extends the ActiveRecord class, so I could use the following code to retrieve the data:</p>
  
  <pre><code>ModelClass::find()-where('big&gt;small')-&gt;andWhere('1&lt;2')-&gt;orWhere('3&gt;1')-&gt;count();
  </code></pre>
  
  <p>I tried to read the documentation of Yii 2.0 but could not figure out how to use NOT BETWEEN OR EQUAL NULL.</p>