Skip to content
No description, website, or topics provided.
PHP
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples
src
tests
.gitignore
.travis.yml
README.md
composer.json
phpstan.neon
ruleset.xml

README.md

Entity generator

Typed entity generator from database. It can generate entities for whole database, table/view and from query


Latest Stable Version Build Status codecov PHPStan Total Downloads License

Installation

$ composer require dodo-it/entity-generator

USAGE:

$config = new \DodoIt\EntityGenerator\Generator\Config([
    'path' =>  __DIR__ . '/Entities',
    'extends' => \Examples\Pdo\Entities\Entity::class,
    'namespace' => 'Examples\Pdo\Entities'
]);

$pdo = new \PDO('mysql:dbname=example;host=127.0.0.1', 'root', '');

$generatorFactory = new \DodoIt\EntityGenerator\Factory\GeneratorPdoFactory($pdo);
$generator = $generatorFactory->create($config);
$generator->generate();

see example folder

You can add your own methods to entities and change getter/setter functions, they won't be overriden when regenerated

Configuration

see src/Generator/Config.php

You can’t perform that action at this time.