lithium\data\Model::config()
Configures the model for use. This method will set the Model::$_schema, Model::$_meta,
Model::$_finders class attributes, as well as obtain a handle to the configured
persistent storage connection.
Parameters
-
array
$configPossible options are:
meta: Meta-information for this model, such as the connection.finders: Custom finders for this model.query: Default query parameters.schema: ASchemainstance for this model.classes: Classes used by this model.
Source
public static function config(array $config = []) {
if (($class = get_called_class()) === __CLASS__) {
return;
}
if (!isset(static::$_instances[$class])) {
static::$_instances[$class] = new $class();
}
$self = static::$_instances[$class];
foreach ($self->_autoConfig as $key) {
if (isset($config[$key])) {
$_key = "_{$key}";
$val = $config[$key];
$self->$_key = is_array($val) ? $val + $self->$_key : $val;
}
}
static::$_initialized[$class] = false;
}