Connections, models and active records are the foundations of everything that concerns database access and management. They are used to establish database connections, manage tables and their relationships, as well as manage the records of these tables. Leveraging OOP, models and active records are classes whose properties, getters/setters, and behavior can be inherited in a business logic.
Using the query interface, you won't have to write raw SQL, manage table relationships, or worry about injection.
Finally, using registries you can define all your connections and models in a single place. Connections are established and models are instantiated on demand, so feel free to define hundreds of them.
- PHP 8.4+
- The
pdoextension, with the driver of your database: SQLite, MySQL, or PostgreSQL.
composer require icanboogie/activerecordTo use the package with the ICanBoogie framework, install icanboogie/bind-activerecord instead.
- Getting started
- Configuration
- Connections
- Schema
- Relations
- Models
- Installing models
- Active records
- The query interface
- Exceptions
- Database engines
See CHANGELOG for the changes between versions, and how to upgrade.
The implementation of the query interface is vastly inspired by Ruby On Rails' Active Record Query Interface.
The project is continuously tested by GitHub Actions.
This project adheres to a Contributor Code of Conduct. By participating in this project and its community, you're expected to uphold this code.
See CONTRIBUTING for details.