Download the PHP package blackcube/active-record without Composer
On this page you can find all versions of the php package blackcube/active-record. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download blackcube/active-record
More information about blackcube/active-record
Files in blackcube/active-record
Package active-record
Short Description Scoped queries, elastic dynamic attributes, Hazeltree nested sets — a toolkit for ActiveRecord
License BSD-3-Clause
Homepage https://github.com/blackcubeio/active-record
Informations about the package active-record
Blackcube ActiveRecord
Scoped queries, elastic dynamic attributes, Hazeltree nested sets — a toolkit for ActiveRecord.
Quickstart
Three building blocks
Scoped queries
Named, composable filters. PHP 8 named arguments flow through __call into typed parameters.
QualifyColumnTrait auto-prefixes column names with the table qualifier. Scopes write simple names, qualification is transparent. No ambiguous column errors in JOINs.
Elastic — Dynamic JSON Schema attributes
JSON column + JSON Schema = dynamic attributes without EAV.
Hazeltree — Nested sets with rational numbers
Tree structure in RDBMS. Read branches in one query. Write without global renumbering.
Based on Dan Hazel's research (2008).
Combined — Elastic + Hazeltree
For models that need both dynamic attributes and tree structure:
Trait architecture
Three layers, zero collision:
| Layer | Purpose | Example |
|---|---|---|
| Base traits | Prefixed methods, protected, no collision |
BaseElasticTrait, BaseHazeltreeTrait |
| Composite traits | __get/__set dispatch, one per model |
ElasticTrait, HazeltreeTrait, HazeltreeElasticTrait |
| Abstract classes | Convenience, just use Trait |
AbstractElasticActiveRecord, AbstractHazeltreeElasticQuery |
Base traits use tryElasticGet() / tryHazeltreeGet() returning bool. Composite traits chain: elastic, then hazeltree, then parent::. No insteadof, no MagicCompose needed.
Tests
500 tests, 2726 assertions across 17 suites.
Documentation
- Overview & prerequisites
- Installation
- API — Scopes & Qualification
- API — Elastic
- API — Hazeltree
- Integration
License
BSD-3-Clause. See LICENSE.md.
Author
Philippe Gaultier [email protected]
All versions of active-record with dependencies
swaggest/json-schema Version ^0.12.43
yiisoft/active-record Version ^1.0
yiisoft/cache Version ^3.2
yiisoft/db Version ^2.0
yiisoft/validator Version ^2.5
php Version ^8.1
yiisoft/event-dispatcher Version ^1.1