public update ( array $condition, array $newData, array $options = [] ) : integer | boolean | ||
$condition | array | description of the objects to update. |
$newData | array | the object with which to update the matching records. |
$options | array | list of options in format: optionName => optionValue. |
리턴 | integer | boolean | number of updated documents or whether operation was successful. |
public function update($condition, $newData, $options = [])
{
$writeResult = $this->database->createCommand()->update($this->name, $condition, $newData, $options);
return $writeResult->getModifiedCount() + $writeResult->getUpsertedCount();
}