feat: initial commit of camelia/orm
Attribute-mapped Active Record ORM for MariaDB/MySQL over PDO. - Attribute-driven metadata: TableName, PrimaryKey, AutoIncrement, Column, Guarded, Ignore, Required, Enum, Nullable, Length, Precision, Unique, UniqueGroup, Index, MaxLength. - Relationship mapping: BelongsTo, HasOne, HasMany, BelongsToMany with batched eager loading and a 3-level depth limit. - Orm entry point with fromArray, fromPdo, fromEnv and nested transactions. - Immutable Query with Cond operators and GroupCond grouping. - Repository read and write API, pagination, and typed exception hierarchy. - Declares PHP >=8.3; Mago and PHPStan pin the parser to 8.3. - MIT license.
This commit is contained in:
commit
66e93e3070
97 files changed
+12188
No files matched your search
@@ -0,0 +1,29 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project are documented here. The format follows
|
||||
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project adheres to
|
||||
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Added
|
||||
|
||||
- Attribute-driven metadata: `TableName`, `PrimaryKey`, `AutoIncrement`, `Column`, `Guarded`,
|
||||
`Ignore`, `Required`, `Enum`, `Nullable`, `Length`, `Precision`, `Unique`, `UniqueGroup`,
|
||||
`Index`, `MaxLength`.
|
||||
- Relationship mapping: `BelongsTo`, `HasOne`, `HasMany`, `BelongsToMany`, with batched eager
|
||||
loading (no N+1) and a hard 3-level depth limit.
|
||||
- `Orm` entry point with `fromArray`, `fromPdo`, `fromEnv` and nested `transaction()`.
|
||||
- `Repository` read API: `find`, `findFirst`, `findByPk`, `findByPkOrFail`, `findOrCreate`,
|
||||
`count`, `exists`, `sum`, `avg`, `max`, `min`, `page`, `query`.
|
||||
- `Repository` write API: `save`, `create`, `update`, `delete`, `patch`, `remove`.
|
||||
- Immutable `Query` with `Cond` operators and `GroupCond` grouping.
|
||||
- Typed exception hierarchy rooted at `OrmException`.
|
||||
- `AuditListener` and PSR-3 `LoggerInterface` extension points.
|
||||
- `TypeCaster` with strict refusal of values that cannot be cast.
|
||||
|
||||
### Notes
|
||||
|
||||
- `Model::hydrate()` accepts property or column keys; the property name wins when both are present.
|
||||
- `Page::$totalPages` is always an `int`.
|
||||
- No global helper functions are registered.
|
||||
Reference in new issue
Block a user