Releases: locomotivemtl/charcoal-core
charcoal-core 0.6.3
Complete commits list: 0.6.2.1...0.6.3
Summary:
- Fixed support for auto-incremented primary key for SQLite databases
- Improved exception messages on
AbstractModel::loadFromL10n()
charcoal-core 0.6.2
Complete commits list: 0.6.1...0.6.2
Summary:
- Improved flow of operations in
ExpressionFieldTrait
- Fixed field name usage in
ExpressionFieldTrait
- Fixed
metadata/config
in service provider to improve logic processingmodule/classes
charcoal-core 0.6.1
Complete commits list: 0.6.0...0.6.1
Summary:
- Improved exception messages for
Source
classes - Changed
AbstractMetadata
to retrieve property by camelized identifier - Changed
AbstractModel::saveProperties()
to skip non-storable properties - Added support for
validatable
flag on property to skip validation if value isfalse
charcoal-core 0.6.0
Complete commits list: 0.5.0...0.6.0
Requires:
Summary:
- Changed method
AbstractModel::setFlatData()
to decouple flat-data processing for model properties - Added method
AbstractModel::flatData()
- Fixed various edge cases where SQL is expected
- Improved field name usage in
ExpressionFieldTrait
charcoal-core 0.5.0
Complete commits list: 0.4.7...0.5.0
Requires:
Changed:
- Method signature for
AbstractValidator::merge()
- Class
ModelValidator
to only validate validatable properties - Moved validation levels from
AbstractValidator
toValidatorInterface
Added:
- Method
AbstractValidator::camelize()
with static caching
Fixed:
- Camelizing of property validation methods
- PHP syntax typo in
AbstractValidator::merge()
method
charcoal-core 0.4.7
Complete commits list: 0.4.6...0.4.7
Summary:
- Added methods
createModel()
andcreateModelFromData()
toCollectionLoader
to improve the process of creating models - Added method
DatabaseSource::dbPrepare()
to prepare the SQL and bind parameters - Added
LazyCollectionLoader
to returnGenerator
instead of processing all objects at once - Added caching for database table checks
- Added support for "values" and "value" for creating a
Filter
- Cleanup SQL queries, collapsed whitespace for easier reading in logs
charcoal-core 0.4.5
- Fix camel case properties.
charcoal-core 0.4.4.1
- Fix a missing ArrayAccess use.
charcoal-core 0.4.4
- Remove metadata loader from the interface.
- Access properties with ArrayAccess.
- Minor code improvements
charcoal-core 0.4.0
Key Features
New Metadata Loader Class
The MetadataLoader
class suffered from design flaws which resulted in poor performance on large projects.
Metadata Caching
Previously, the MetadataLoader
would store MetadataInterface
instances into the cache pool with the belief the pool would return those same instances. Unfortunately, depending on the cache driver, the instances would be serialized when stored and unserialized into new objects when retrieved. This would cause the cache to miss every time.
This is resolved by storing MetadataInterface
instances in a static class property (MetadataLoader::$metadataCache
) and storing only the raw data in the cache pool.
Metadata Creation
Previously, the MetadataLoader
required a MetadataInterface
instance every time the Loader was called upon to retrieve metadata from the cache (or from the file system). If the data was retrieved from the cache pool, the given instance would be ignored in favour of the instance returned by the pool. This lead to a lot of unnecessary object instantiations.
This is resolved by delegating the instantiation of the MetadataInterface
class to the MetadataLoader
.
New Metadata Config Class
The MetadataConfig
allows one to customize the MetadataLoader
service. The configset stores the Loader's settings, search paths, and cache pool preference.
For an example of a customized Loader, locomotivemtl/charcoal-admin v0.12.x takes advantage of this feature to append extra "admin-only" metadata paths and swap the cache pool.
BC Breaks
Describable Classes:
The DescribableTrait::loadMetadata()
method uses a new DescribableTrait::metadataClass()
method instead of DescribableTrait::createMetadata()
Renamed Methods:
Before | After |
---|---|
MetadataLoader::classnameToIdent |
metaKeyFromClassName |
MetadataLoader::identToClassname |
classNameFromMetaKey |
MetadataLoader::filenameFromIdent |
filePathFromMetaKey |
MetadataLoader::loadData |
loadMetadataByKey |
MetadataLoader::loadDataArray |
loadMetadataByKeys |
MetadataLoader::loadFileFromIdent |
loadMetadataFromSource |
What's new in 0.4.0?
Dependencies
- locomotivemtl/charcoal-config v0.9.x
- locomotivemtl/charcoal-property v0.7.x
- locomotivemtl/charcoal-view v0.3.x
Added
- Dependency to locomotivemtl/charcoal-cache
DescribableTrait::metadataClass()
abstract method for defining the model's metadata classAbstractModel::metadataClass()
concrete method as per changes toDescribableTrait
- Class
MetadataConfig
for handlingconfig.metadata
settings - Container entry
metadata/config
to model service provider forconfig.metadata
settings - Container entry
metadata/cache
to model service provider for customizing the cache pool used byMetadataLoader
Changed
- Synchronized operations between methods
AbstractModel::objType()
andDescribableTrait::generateMetadataIdent()
AbstractModel::createMetadata()
method to use new::metadataClass()
method- Breaking:
DescribableTrait::loadMetadata()
method to use new::metadataClass()
method to delegate metadata class instantiation toMetadataLoader
- Complete rewrite of
MetadataLoader
class [2fce5f0...d8c4145
]
Fixed
- Caching of instances of
MetadataInterface
inMetadataLoader
- Caching of metadata, loaded from filesystem, in
MetadataLoader
cache pool