yii\db\BaseActiveRecord::updateAll PHP 메소드

updateAll() 공개 정적인 메소드

For example, to change the status to be 1 for all customers whose status is 2: php Customer::updateAll(['status' => 1], 'status = 2');
public static updateAll ( array $attributes, string | array $condition = '' ) : integer
$attributes array attribute values (name-value pairs) to be saved into the table
$condition string | array the conditions that will be put in the WHERE part of the UPDATE SQL. Please refer to [[Query::where()]] on how to specify this parameter.
리턴 integer the number of rows updated
    public static function updateAll($attributes, $condition = '')
    {
        throw new NotSupportedException(__METHOD__ . ' is not supported.');
    }

Usage Example

예제 #1
0
 /**
  * @inheritdoc
  * @todo
  */
 public static function updateAll($attributes, $condition = '')
 {
     parent::updateAll($attributes, $condition);
 }