title: Active Record Delete works false
body: <p>I try to delete entries in the database with the active records of Yii. But I think it works really weird. 
  I want to delete all records of my table where vehicle_id = the given id and plug_id NOT IN (given string)</p>
  
  <p>I tried a lot of ways and nothing worked but this</p>
  
  <pre><code>$query = "delete from `vehicle_details` where `vehicle_id`= ".$vehicle-&gt;id." AND `plug_id` NOT IN (".implode(',', array_map(function($item) {
                                      return $item-&gt;type;
                                  }, $vehicleDetails-&gt;plug)).")";
          $command = Yii::app()-&gt;db-&gt;createCommand($query);
          $command-&gt;execute();
  </code></pre>
  
  <p>But why isn't this working???</p>
  
  <pre><code>VehicleDetail::model()-&gt;DeleteAllByAttributes(
          array('vehicle_id' =&gt; $vehicle-&gt;id), 
          array('condition' =&gt; 'plug_id NOT IN (:ids)',
              'params' =&gt; array('ids' =&gt; implode(',', array_map(function($item) {
                                      return $item-&gt;type;
                                  }, $vehicleDetails-&gt;plug)))));
  </code></pre>
  
  <p>Or this:</p>
  
  <pre><code>VehicleDetail::model()-&gt;deleteAll(' vehicle_id = :vehicleId AND plug_id NOT IN (:ids)', array('vehicleId' =&gt; $vehicle-&gt;id, 'ids' =&gt; implode(',', array_map(function($item) {
                                  return $item-&gt;type;
                              }, $vehicleDetails-&gt;plug))));
  </code></pre>
  
  <p>But if I make and Find by attributes out of this query it works well and returns the correct data. </p>
  
  <p>I hope you can explain it to me. </p>