lithium\data\Collection::set()

public method

Allows several items to be assigned at once.

For example:

$collection->set(array(
	42 => array('title' => 'Lorem Ipsum'),
	43 => array('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;
		}
	}