lithium\data\model\Query::data()

public method

Set and get method for the query's record's data.

Parameters

  • array $data

    if set, will set given array.

Returns

array

Empty array if no data, array of data if the record has it.

Source

	public function data($data = []) {
		$bind =& $this->_entity;

		if ($data) {
			$bind ? $bind->set($data) : $this->_data = array_merge($this->_data, $data);
			return $this;
		}
		$data = $bind ? $bind->data() : $this->_data;
		return ($list = $this->_config['whitelist']) ? array_intersect_key($data, $list) : $data;
	}