lithium\data\Collection::set()

public method

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

void

Source

	public function set($values) {
		foreach ($values as $key => $val) {
			$this[$key] = $val;
		}
	}