Extends
lithium\core\Object
Converts the data in the record set to a different format, i.e. an array.
Parameters
- string $format currently only `array`
- array $options
Returns
mixedSource
public function to($format, array $options = array()) {
switch ($format) {
case 'array':
$data = $this->_updated;
$rel = array_map(function($obj) { return $obj->data(); }, $this->_relationships);
$data = $rel + $data;
$result = Collection::toArray($data, $options);
break;
default:
$result = $this;
break;
}
return $result;
}