- PHP 8.2+
- Added interface
ModelProvider
.ModelCollection
implements it. Better use this one than depend onModelCollection
. - Added
SchemaBuilder
to build schema using a fluent API. - Added
through
option forhas_may
relationship. - Added a config builder.
- The static methods
ActiveRecord::query()
andwhere()
can be used to create a query directly from an ActiveRecord.
- The
ActiveRecord
class is now abstract and require extension. - The
Query
class is now defined by theModel
instead of provided byModelDefinition
. Thequery_class
directive has been removed. - Model parents are now resolved using PHP inheritance on ActiveRecord classes. The
extends
directive has been removed. - Models are now identified by their ActiveRecord, the
id
property has been removed. Table
requires aConnection
instance in its constructor, theCONNECTION
attribute is no longer replaced by aConnection
instance.- Replaced attributes arrays to initialize tables and models with objects.
ConnectionCollection
andModelCollection
no longer implementArrayAccess
, and are read only. Use theconnection_for_id()
method to obtain a connection. Use themodel_for_record()
method to obtain a model.- Removed
Model::join()
. - Removed support for
implements
inTable
. - Removed
get_model()
- Removed the notion of scopes on Model, they are better replaced with Query extensions.
- Removed forwarded query methods on the model. Still
query()
andwhere()
remain available. - The
Model
class no longer implementsArrayAccess
.
None
ActiveRecord
usesStaticModelProvider
to obtain its model.- For models extending other models, the primary key is now inherited during config building instead of resolved during
Table
constructor.