tina4stack / tina4php-orm
Tina4 ORM Module
v2.0.23
2026-03-14 19:36 UTC
Requires
- php: >=8.1
Requires (Dev)
- overtrue/phplint: ^2.0
- phpmetrics/phpmetrics: ^2.8
- phpunit/phpunit: ^9
- roave/security-advisories: dev-latest
- tina4stack/tina4php-firebird: ^2.0
This package is auto-updated.
Last update: 2026-03-14 19:46:39 UTC
README
Object-relational mapping module for the Tina4 PHP framework, providing a simple ORM that works with any Tina4 database driver.
Installation
composer require tina4stack/tina4php-orm
Requirements
- PHP >= 8.1
Usage
Defining a Model
use Tina4\ORM; class User extends ORM { public $primaryKey = "id"; public $tableName = "users"; public $id; public $firstName; public $lastName; public $email; }
Loading and Saving Records
// Load a user by primary key $user = (new User()); $user->load("id = 1"); echo $user->firstName; // Create a new user $user = new User(); $user->firstName = "Alice"; $user->lastName = "Smith"; $user->email = "alice@example.com"; $user->save();
Querying Multiple Records
$users = (new User())->select("*", 10) ->filter("active = 1") ->orderBy("last_name") ->asArray();
Testing
composer test
License
MIT - see LICENSE
Our Sponsors
Sponsored with 🩵 by Code Infinity
Supporting open source communities • Innovate • Code • Empower