lithium\data\source\Database::_createFields()
Renders the fields part for create queries.
Parameters
-
array
$data
-
array
$schema
An array defining the schema of the fields used in the criteria.
-
object
$context
Generally a
data\model\Query
instance.
Returns
arrayArray with fields
and values
keys which hold SQL fragments of fields
an values separated by comma.
Source
protected function _createFields($data, $schema, $context) {
$fields = array();
$values = array();
foreach ($data as $field => $value) {
$fields[] = $this->name($field);
$values[] = $this->value($value, isset($schema[$field]) ? $schema[$field] : array());
}
return array(
'fields' => join(', ', $fields),
'values' => join(', ', $values)
);
}