PHPackages                             subsan/entity-generator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. subsan/entity-generator

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

subsan/entity-generator
=======================

PHP entity generator

1.0.2(7y ago)096Apache-2.0PHPPHP &gt;=7.0

Since Sep 27Pushed 7y ago1 watchersCompare

[ Source](https://github.com/subsan/entity-generator)[ Packagist](https://packagist.org/packages/subsan/entity-generator)[ RSS](/packages/subsan-entity-generator/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (2)Versions (3)Used By (0)

PHP entity generator
====================

[](#php-entity-generator)

Entity generator

Requirements
------------

[](#requirements)

- [PHP 7.0.0 or higher](http://www.php.net/)

Installation
------------

[](#installation)

You can use **Composer** or simply **Download the Release**

### Composer

[](#composer)

The preferred method is via [composer](https://getcomposer.org). Follow the [installation instructions](https://getcomposer.org/doc/00-intro.md) if you do not already have composer installed.

Once composer is installed, execute the following command in your project root to install this library:

```
composer require subsan/entity-generator:"^1.0"
```

Finally, be sure to include the autoloader:

```
require_once '/path/to/your-project/vendor/autoload.php';
```

### Download the Release

[](#download-the-release)

If you abhor using composer, you can download the package in its entirety. The [Releases](https://github.com/subsan/entity-generator/releases) page lists all stable versions. Download any file with the name `entity-generator-[RELEASE_NAME].zip` for a package including this library and its dependencies.

Uncompress the zip file you download, and include the autoloader in your project:

```
require_once '/path/to/entity-generator/vendor/autoload.php';
```

Using
-----

[](#using)

```
/vendor/bin/entityGenerator [YAML-file-path]
```

Basic Example
-------------

[](#basic-example)

Example file `vendor/subsan/entity-generator/example/GeneratorConfigField.yaml` contains:

```
name: GeneratorConfigField
namespace: Subsan\EntityGenerator
fields:
  Name:
    type: string
    description: Name of field
  Type:
    type: string
    description: Type of field
  Description:
    type: string
    description: Description for field
    setNull: true
```

run in console:

```
vendor/bin/entityGenerator vendor/subsan/entity-generator/example/GeneratorConfigField.yaml > GeneratorConfigField.php
```

Generate file GeneratorConfigField.php contains:

```
