Skip to content

Commit

Permalink
Add documentation close #11
Browse files Browse the repository at this point in the history
  • Loading branch information
dakorpar authored and Milan Felix Šulc committed Mar 21, 2019
1 parent 155fefc commit 9bde124
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 141 deletions.
47 changes: 47 additions & 0 deletions .docs/README.md
@@ -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
46 changes: 37 additions & 9 deletions README.md
Expand Up @@ -9,26 +9,54 @@ Tool for generating entities for [Nextras\ORM](https://github.com/nextras/orm).
[![Downloads this Month](https://img.shields.io/packagist/dm/contributte/nextras-orm-generator.svg?style=flat-square)](https://packagist.org/packages/contributte/nextras-orm-generator)
[![Latest stable](https://img.shields.io/packagist/v/contributte/nextras-orm-generator.svg?style=flat-square)](https://packagist.org/packages/contributte/nextras-orm-generator)

## Discussion / Help

[![Join the chat](https://img.shields.io/gitter/room/contributte/contributte.svg?style=flat-square)](http://bit.ly/ctteg)

## Install

```sh
composer require --dev contributte/nextras-orm-generator
```

## ORM
## About

This little tool can generate:

* Entity
* Repository
* Mapper
* Facade
* Model

## Overview

- [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)

## Maintainers

<table>
<tbody>
<tr>
<td align="center">
<a href="https://github.com/f3l1x">
<img width="150" height="150" src="https://avatars2.githubusercontent.com/u/538058?v=3&s=150">
</a>
</br>
<a href="https://github.com/f3l1x">Milan Felix Šulc</a>
</td>
<td align="center">
<a href="https://github.com/dakorpar">
<img width="150" height="150" src="https://avatars2.githubusercontent.com/u/9303856?s=150&v=4">
</a>
</br>
<a href="https://github.com/dakorpar">Dalibor Korpar</a>
</td>
</tr>
</tbody>
</table>

## WARNING

This handy tool is currently under massive active developing. So please be patient.

## Usage

See more in folder example.
-----

Thank you for testing, reporting and contributing.
25 changes: 0 additions & 25 deletions example/boot.php

This file was deleted.

100 changes: 0 additions & 100 deletions example/db.sql

This file was deleted.

7 changes: 0 additions & 7 deletions example/readme.md

This file was deleted.

Binary file removed example/schema.png
Binary file not shown.

0 comments on commit 9bde124

Please sign in to comment.