lithium\data\Collection::set()
Allows several items to be assigned at once.
For example:
$collection->set([
42 => ['title' => 'Lorem Ipsum'],
43 => ['title' => 'Dolor Amet']
]);
Parameters
-
arary
$values
An associative array of fields and values to assign to the
Collection
.
Returns
voidSource
public function set($values) {
foreach ($values as $key => $val) {
$this[$key] = $val;
}
}