crysalead / chaos-orm
Data Abstraction Layer.
Installs: 8 759
Dependents: 2
Suggesters: 0
Security: 0
Stars: 2
Watchers: 4
Forks: 2
Open Issues: 0
Requires
- php: >=7.0
- crysalead/box: ~2.0
- crysalead/inflector: ~2.0
- crysalead/set: ~2.0
- crysalead/text: ~2.0
- crysalead/validator: ~3.0
Requires (Dev)
- kahlan/kahlan: ~5.1
This package is auto-updated.
Last update: 2024-11-07 01:28:53 UTC
README
Chaos is an independent, persistence-agnostic layer responsible for defining entities' business logic and relationships. It allows to describe a Domain Model without any assumption about the persistence layer.
Note: The Chaos syntax is derived from li3. If the syntax is not fully compatible with its predecessor, some effort has been made to keep the same clean and beautiful syntax.
Available datasources libraries:
- chaos-database: supports MySQL and PostgreSQL.
Chaos dramatically simplify the developpment of a datasources libraries by providing all persistence-agnostic logic like relationships, eager/lazy loading, validations, etc. at the root level. The only requirement is the datasource you envisionned to use need to be able to fetch a record/document thanks to a unique identifier (i.e no composite primary key).
Requirements
- PHP 5.5+
Main Features
- Support eager/lazy loading
- Support custom finders
- Support nested saving
- Support nested validations
- Support external & embedded relationship
- Support custom types & entities' field casting
Example of syntax:
use My\Project\Model\Images; // Adding a many-to-many relation $image = Image::load(123); $image->tags[] = ['name' => 'Landscape']; $image->broadcast(); foreach($image->tags as $tag) { // Echoes: 'Montain', 'Black&White', 'Landscape' echo $tag->name; }
Documentation
See the whole documentation here.
Testing
The spec suite can be runned with:
cd chaos
composer install
./bin/kahlan