PHP Classes

PDO One ORM: Access SQL database tables as object using PDO

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 18 All time: 11,390 This week: 206Up
Version License PHP version Categories
pdooneorm 1.0GNU Lesser Genera...5PHP 5, Databases, Code Generation
Description 

Author

This package can access SQL database tables as objects using PDO.

It can generate classes that can perform operations to manipulate table records as if they were objects, like creating and retrieving, updating, and deleting table records.

The package can also perform database table alterations using parameters to define the table fields and indexes.

Picture of Jorge Castro
  Performance   Level  
Innovation award
Innovation award
Nominee: 14x

Winner: 2x

 

Example

<?php /** @noinspection ForgottenDebugOutputInspection */

use eftec\examples\example1\repo\FilmTextRepo;
use
eftec\PdoOneORM;
use
eftec\tests\sakila2021\CityRepo;

include
'../../vendor/autoload.php';

include
__DIR__.'/phpconf.php';
/** @noinspection PhpUndefinedVariableInspection */
$pdo=PdoOneORM::factoryFromArray($pdoOneConfig);
$pdo->connect();
$pdo->logLevel=3;

echo
"<h1>Dropping table</h1>";
FilmTextRepo::dropTable();
echo
"<h1>Creating table</h1>";
FilmTextRepo::createTable();
echo
"<h1>Truncating table</h1>";
FilmTextRepo::truncate(true);

echo
"<h1>Listing paged</h1>";
var_dump(CityRepo::page(2,5)->toList());

echo
"<h1>Listing join</h1>";
var_dump(CityRepo::innerjoin('country on city.country_id=country.country_id')->toList());
echo
"<h1>Listing table</h1>";
var_dump(CityRepo::recursive(['/_country_id'])->toList());
echo
"<h1>Listing cache (if available)</h1>";
var_dump(CityRepo::useCache(0)->toList());


  Files folder image Files (126)  
File Role Description
Files folder imageexamples (2 directories)
Files folder imagelib (4 files, 1 directory)
Files folder imagetests (4 files, 1 directory)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Read me

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:18
This week:0
All time:11,390
This week:206Up