Native PDO adapter for alxarafe/resource-controller.
Implements RepositoryContract, QueryContract, and TransactionContract using pure PHP PDO, without relying on ORMs or heavy database libraries.
| Package | Purpose | Status |
|---|---|---|
| resource-controller | Core CRUD engine + UI components | ✅ Stable |
| resource-eloquent | Eloquent ORM adapter | ✅ Stable |
| resource-pdo | Native PDO adapter | ✅ Stable |
| resource-blade | Blade template renderer adapter | ✅ Stable |
| resource-twig | Twig template renderer adapter | ✅ Stable |
| resource-html | Pure PHP/HTML template renderer adapter | ✅ Stable |
composer require alxarafe/resource-pdouse Alxarafe\ResourceController\AbstractResourceController;
use Alxarafe\ResourceController\Contracts\RepositoryContract;
use Alxarafe\ResourceController\Contracts\TransactionContract;
use Alxarafe\ResourcePdo\PdoRepository;
use Alxarafe\ResourcePdo\PdoTransaction;
class UsersController extends AbstractResourceController
{
private \PDO $pdo;
public function __construct(\PDO $pdo) {
$this->pdo = $pdo;
}
protected function getRepository(string $tabId = 'default'): RepositoryContract
{
return new PdoRepository($this->pdo, 'users', 'id');
}
protected function getTransaction(): TransactionContract
{
return new PdoTransaction($this->pdo);
}
}- Dependency-free database access using native PHP
\PDO. - Fast, secure, and prepared statements out-of-the-box.
- Seamless compatibility with
alxarafe/resource-controllerconfiguration array definitions.
GPL-3.0-or-later