Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
84 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Nextras ORM generator | ||
|
||
## Content | ||
- [Installation](https://github.com/contributte/nextras-orm-generator/blob/master/.docs/README.md#usage) | ||
- [Usage - how to run](https://github.com/contributte/nextras-orm-generator/blob/master/.docs/README.md#usage) | ||
- [Configuration - how to configure](https://github.com/contributte/nextras-orm-generator/blob/master/.docs/README.md#configuration) | ||
|
||
## Installation | ||
Most common way to install this tool is with composer: | ||
```sh | ||
composer require --dev contributte/nextras-orm-generator | ||
``` | ||
This script does not require to be part of your project so you can install it anywhere you like and just provide path to desired dir where entities will be generated. | ||
|
||
|
||
## Usage | ||
1) Generate all entities in same folder (together) | ||
```php | ||
$config = [ | ||
'output' => __DIR__ . '/model/together', | ||
//other options | ||
]; | ||
$factory = new SimpleFactory( | ||
new TogetherConfig($config), | ||
new DatabaseAnalyser('mysql:host=127.0.0.1;dbname=nextras_orm_generator', 'root') | ||
); | ||
|
||
$factory->create()->generate(); | ||
``` | ||
|
||
2. Generate entities separately | ||
```php | ||
$config = [ | ||
'output' => __DIR__ . '/model/together', | ||
//other options | ||
]; | ||
$factory = new SimpleFactory( | ||
new SeparateConfig($config), | ||
new DatabaseAnalyser('mysql:host=127.0.0.1;dbname=nextras_orm_generator', 'root') | ||
); | ||
|
||
$factory->create()->generate(); | ||
``` | ||
|
||
## Configuration | ||
This tool is highly configurable, take a look at configuration class for list of all available options: | ||
https://github.com/contributte/nextras-orm-generator/tree/master/src/Config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.