Download the PHP package ez-php/orm without Composer
On this page you can find all versions of the php package ez-php/orm. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Vendor ez-php
Package orm
Short Description ORM module for the ez-php framework — Active Record style models with a fluent query builder and schema builder
License MIT
Homepage https://github.com/ez-php/orm
Package orm
Short Description ORM module for the ez-php framework — Active Record style models with a fluent query builder and schema builder
License MIT
Homepage https://github.com/ez-php/orm
Please rate this library. Is it a good library?
Informations about the package orm
ez-php/orm
ORM module for the ez-php framework — Data Mapper pattern with Entity, AbstractRepository, a fluent QueryBuilder, and a Schema builder.
Requirements
- PHP 8.5+
- ext-pdo
- ez-php/framework 0.*
Installation
Setup
Register the service providers:
Usage
Defining an entity
Defining a repository
Persisting
Querying
Soft deletes
Relations
Define relation helpers on the repository, then call them on an entity:
Custom casts
Entity lifecycle observers
Attach observers to a repository to react to create/update/delete events:
The *ing hooks fire before the DB operation; *ed hooks fire after.
Schema builder
Console commands
| Command | Description |
|---|---|
make:entity |
Scaffolds an Entity subclass in src/Entities/ |
make:repository |
Scaffolds an AbstractRepository subclass in src/Repositories/ |
Classes
| Class | Description |
|---|---|
Entity |
Abstract Data Mapper entity base; attributes, casts, fillable guards, relation storage |
AbstractRepository |
Abstract repository base; INSERT/UPDATE/DELETE, dirty tracking, relations, eager-load |
EntityObserverInterface |
Lifecycle hook contract: creating/created/updating/updated/deleting/deleted |
ObservableRepositoryTrait |
Adds observer support to a repository; fires hooks around save() and delete() |
EntityQueryBuilder |
Typed fluent query builder for entities; with(), withCount(), paginate() |
EntityServiceProvider |
Calls Entity::setDatabase($db) in boot() |
Hydrator |
Converts raw DB rows → Entity instances and Entity attributes → storage arrays |
CastableInterface |
Interface for custom value-object casts: castFrom()/castTo() |
DuplicateKeyException |
Thrown by save() on duplicate-key violations |
Paginator |
Immutable page-of-results value object |
QueryBuilder |
Fluent SQL builder for raw rows; all WHERE/JOIN/ORDER/LIMIT/aggregates/paginate/chunk/cache |
EntityHasMany |
One-to-many relation (FK on related entity) |
EntityHasOne |
One-to-one relation (FK on related entity) |
EntityBelongsTo |
Inverse of HasMany/HasOne (FK on owning entity) |
EntityBelongsToMany |
Many-to-many relation via pivot table |
Schema |
DDL façade: create(), table(), drop(), dropIfExists(), hasTable() |
Blueprint |
Column and constraint builder for CREATE TABLE and ALTER TABLE |
License
MIT — Andreas Uretschnig
All versions of orm with dependencies
PHP Build Version
Package Version
Requires
php Version
^8.5
ez-php/contracts Version ^1.0
ez-php/console Version ^1.0
ez-php/cache Version ^1.0
ez-php/contracts Version ^1.0
ez-php/console Version ^1.0
ez-php/cache Version ^1.0
The package ez-php/orm contains the following files
Loading the files please wait ...