lithium\data\source\Database::_splitFieldname()
Return the alias and the field name from an identifier name.
Parameters
-
string
$fieldField name or identifier name.
Returns
arrayReturns an array with the alias (or null if not applicable) as first value
and the field name as second value.
Source
protected function _splitFieldname($field) {
$regex = '/^([a-z0-9_-]+)\.([a-z 0-9_-]+|\*)$/iS';
if (strpos($field, '.') !== false && preg_match($regex, $field, $matches)) {
return [$matches[1], $matches[2]];
}
return [null, $field];
}