The Core package provides abstract objects and tools for defining object data models and managing datasource connections.
composer require charcoal/core
For Charcoal projects, the service provider can be registered from your configuration file:
{
"service_providers": {
"charcoal/model/service-provider/model": {}
}
}
TODO
TODO
Source
provides storage support to Charcoal models.
Using a Source
object directly:
$model = ModelFactory::instance()->create('namespace/model');
$source = SourceFactory::instance()->create('database');
$source->load_item(1, $model);
Using a Storable
object, which abstract away the Source
completely.
// Model implements StorableInterface with StorableTrait
$model = ModelFactory::instance()->create('namespace/model');
// This will load the Model's source from it's metadata
$model->load(1);
Currently, only the database
source is supported.
The DatabaseSource
source type is currently the only supported storage source.
- Implements a
FileSource
, at least a basic CSV support. - Move
CollectionLoader
to here, somehow.
The validator namespace is obsolete and should not be used. Its usage is currently being removed from everywhere in charcoal.