Overview of ThinkORM 4.0 features
4.0ThinkORM 4.0 is a lightweight ORM implemented using PHP 8.0+ and PDO. It features a completely refactored Model layer that supports both Entity models and layered architectures. It is designed to be largely compatible with version 3.0.
Key capabilities include:
- Querying: Native query support, flexible query builder with chainable methods, automatic parameter binding, and aggregate queries.
- Modeling: Powerful model and association definitions, support for ActiveRecord and Repository patterns, model events, and type auto-conversion.
- Data Handling: Model accessors and modifiers, support for JSON and Enum classes, automatic data validation on write, and lazy/automatic writing.
- Advanced Features: Virtual models, Entity and View models, searchers, query scopes, and preloading/lazy-loading of associations.
- Infrastructure: Support for multiple databases (including
MongoDb), distributed transactions, breakpoint reconnection,PSR-16cache, andPSR-3logging.