Ignacio Rojas Fri Feb 18 08:39:24 -0500 2011

Subject: Mass Update and Delete

Can you set conditions to Model::Table( )->update($data, $conditions ) or Model::Table( )->delete( $data, $conditions)

where

$data = array( 'status' => 0);
$conditions = array( 'conditions' => 'id> 15');

???

senting $conditions = array( 'id', array( 1,2,3,4)); works.


Devi Mandiri Sat Feb 19 05:40:57 -0500 2011

mass update:

Model::update_all(array(
  'set' => array(
    'status' => 0
  ),
  'conditions' => array(
    'id' => array(1,2,3,4)
  )
));

never tried(yet) Model::delete_all()

(1-1/1)