helicon / db
dev-main
2023-08-24 15:08 UTC
Requires
- php: >=8.2
- ext-pdo: *
- helicon/object-mapper: ^1.1
- nilportugues/sql-query-builder: ^1.8
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.23
- phpunit/phpunit: ^10.3
This package is auto-updated.
Last update: 2024-10-24 17:42:00 UTC
README
A Database Object mapping library for PHP.
How To Use
<?php use Helicon\Db\HeliconDb; require __DIR__ . '/vendor/autoload.php'; class User { public readonly int $id; public readonly string $email; public readonly string $name; } $heliconDb = HeliconDb::create('mysql:host=127.0.0.1;port=3307;dbname=helicon', 'docker', 'docker'); $selectTarget = $heliconDb->select(User::class); $query = $selectTarget->createQuery()->where()->equals('id', 1)->end(); $users = $selectTarget->execute($query); var_dump($users);