Extends
lithium\core\ObjectSource
protected function _init() {
parent::_init();
$config =& $this->_config;
$type = $config['type'];
$name = ($type == 'hasOne') ? Inflector::pluralize($config['name']) : $config['name'];
$config['fieldName'] = $config['fieldName'] ?: lcfirst($name);
if (!$config['to']) {
$assoc = preg_replace("/\\w+$/", "", $config['from']) . $name;
$config['to'] = Libraries::locate('models', $assoc);
}
if (!$config['key'] || !is_array($config['key'])) {
$config['key'] = $this->_keys($config['key']);
}
}