DEFAULT_SOURCE_TYPE
DEFAULT_SOURCE_TYPE
$metadataLoader : \Charcoal\Model\Service\MetadataLoader
build(string $objType, string|null $metadataIdent = null, string|null $sourceIdent = null) : \Charcoal\Model\Service\ModelInterface
Build a model, pre-initializing its metadata and its source.
By default, the name of the "obj type" (the model class name) is used to determine the metadata ident to load.
To load a custom metadata for the object, use the $metadataIdent
argument.
By default, the object's default source (from its metadata) is used as source.
To load a custom source for the object, use the $sourceIdent
argument.
string | $objType | The object type of the Model. |
string|null | $metadataIdent | Optional. The metadata ident of the object. |
string|null | $sourceIdent | Optional. The custom source ident to load as source. |
__invoke(string $objType, string|null $metadataIdent = null, string|null $sourceIdent = null) : \Charcoal\Model\Service\ModelInterface
The builder can be invoked (used as function).
string | $objType | The object type of the Model. |
string|null | $metadataIdent | Optional. The metadata ident of the object. |
string|null | $sourceIdent | Optional. The custom source ident to load as source. |
setFactory(\Charcoal\Factory\FactoryInterface $factory) : \Charcoal\Model\Service\ModelLoaderBuilder
\Charcoal\Factory\FactoryInterface | $factory | The factory to use to create models. |
Chainable
setMetadataLoader(\Charcoal\Model\Service\MetadataLoader $loader) : \Charcoal\Model\Service\DescribableInterface
\Charcoal\Model\Service\MetadataLoader | $loader | The loader instance, used to load metadata. |
Chainable
setSourceFactory(\Charcoal\Factory\FactoryInterface $factory) : \Charcoal\Model\Service\ModelLoaderBuilder
\Charcoal\Factory\FactoryInterface | $factory | The factory to use to create models. |
Chainable
createMetadata(string $objType, string|null $metadataIdent = null) : \Charcoal\Model\Service\MetadataInterface
string | $objType | The type of object to load. (A class name or object identifier). |
string|null | $metadataIdent | Optional. The metadata identifier to load. If NULL, it will be implied from objType. |
createSource(\Charcoal\Model\ModelMetadata $metadata, string|null $sourceIdent = null) : \Charcoal\Model\Service\SourceInterface
\Charcoal\Model\ModelMetadata | $metadata | The object metadata, where to find the object's source configuration. |
string|null | $sourceIdent | Optional. Custom source ident to load. If NULL, the default (from metadata) will be used. |
If the source is not defined in the model's metadata.