A lightweight database/PDO abstraction layer with an ORM like system for mapping data.
Currently only tested with MySQL.
Add the package as a requirement to your composer.json
:
$ composer require starlit/db
<?php
// Adding a user using SQL
$db = new Db('localhost', 'db_user', '****', 'database_name');
$db->insert('users_table', ['name' => 'John Doe']);
// Adding a user using object mapping
$service = new BasicDbEntityService($db);
$user = new User();
$user->setName('John Doe');
$service->save($user);
- Requires PHP 7.4 or above.
This software is licensed under the BSD 3-Clause License - see the LICENSE
file for details.