Yii2 delete all rows based on an equal to condition and a not in condition
<p>Here I am using <a href="http://www.yiiframework.com/doc-2.0/index.html" rel="nofollow">Yii2</a> for developing an application. It is slightly different from Yii1. During the development, I am just stuck on a point that I need a delete functionality for an area.
For deleting some rows from <code>DB</code> I am using <a href="http://www.yiiframework.com/doc-2.0/yii-db-activerecord.html#deleteAll()-detail" rel="nofollow">deleteAll()</a> method like the following:</p>

<pre><code>Model::deleteAll(['not in', '&lt;attribute_1&gt;', $attribute_1_values_array]);
</code></pre>

<p>It is working fine for me. But now I want to append another condition to this delete function like:</p>

<pre><code>&lt;attribute_2&gt;=&lt;attribute_2_value&gt;
</code></pre>

<p>I know we can use <code>where()</code> for adding conditions with <code>delete()</code> and then I tried it with this <code>deleteAll()</code> method. But it didn't support.</p>

<p>Here I need to combine both <code>not in</code> condition and <code>equal to</code> condition in the same query.</p>

<p>Any help will be appreciated.</p>