PHPackages                             drago-ex/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. [CLI &amp; Console](/categories/cli)
4. /
5. drago-ex/generator

ActiveLibrary[CLI &amp; Console](/categories/cli)

drago-ex/generator
==================

A lightweight CLI tool for generating PHP entity and data class files from your database schema.

v1.1.1(1mo ago)17061MITPHPPHP &gt;=8.3 &lt;9CI passing

Since Nov 1Pushed 1w ago1 watchersCompare

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

READMEChangelog (10)Dependencies (18)Versions (32)Used By (1)

Drago Generator
===============

[](#drago-generator)

A lightweight CLI tool for generating PHP entity and data class files from your database schema. Drago Generator is built on Nette, Dibi, and Symfony Console, and allows you to create ready-to-use PHP classes for your tables with configurable constants, references, suffixes, and namespaces.

[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://github.com/drago-ex/generator/blob/master/license)[![PHP version](https://camo.githubusercontent.com/0b5915ee6930eb5820b9ce290250a9ccf674a7c2528b2f90e9368141b5da269e/68747470733a2f2f62616467652e667572792e696f2f70682f647261676f2d657825324667656e657261746f722e737667)](https://badge.fury.io/ph/drago-ex%2Fgenerator)[![Tests](https://github.com/drago-ex/generator/actions/workflows/tests.yml/badge.svg)](https://github.com/drago-ex/generator/actions/workflows/tests.yml)[![Coding Style](https://github.com/drago-ex/generator/actions/workflows/coding-style.yml/badge.svg)](https://github.com/drago-ex/generator/actions/workflows/coding-style.yml)

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

[](#requirements)

- PHP &gt;= 8.3
- Nette Framework
- Symfony Console
- Dibi
- Composer

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

[](#installation)

```
composer require drago-ex/generator --dev

```

Examples
--------

[](#examples)

Run generation commands using the Composer-installed binary:

```
# Generate entity classes
php vendor/bin/generator app:entity

# Generate data classes
php vendor/bin/generator app:dataClass
```

```
# Generate all entities
php vendor/bin/generator app:entity

# Generate entity for a specific table
php vendor/bin/generator app:entity users

# Generate all data classes
php vendor/bin/generator app:dataClass

# Generate data class for a specific table
php vendor/bin/generator app:dataClass orders
```

Register Generator Extension in Nette
-------------------------------------

[](#register-generator-extension-in-nette)

```
extensions:
    generator: Drago\Generator\DI\GeneratorExtension(%consoleMode%)
    console: Contributte\Console\DI\ConsoleExtension(%consoleMode%)

# Generator
generator:
	# base (typical of Oracle)
	lower: false

	# generator entity
	path: %appDir%/Entity
	tableName: 'Table'
	primaryKey: 'PrimaryKey'
	columnInfo: false
	constant: true
	constantSize: false
	constantPrefix: 'Column'
	references: false
	suffix: Entity
	extendsOn: true
	extends: Drago\Database\Entity
	final: false
	namespace: App\Entity

	# generator data class
	pathDataClass: %appDir%/DataClass
	constantDataClass: true
	constantSizeDataClass: true
	constantDataPrefix: 'Form'
	referencesDataClass: false
	suffixDataClass: Data
	extendsDataClass: Drago\Utils\ExtraArrayHash
	finalDataClass: false
	namespaceDataClass: App\DataClass

# Symfony Console
console:
	name: Symfony Console
	version: '1.0'
```

Features
--------

[](#features)

- Generate entity and data classes from database tables
- Configurable constants and column size constants
- Support for foreign key references
- Set custom suffixes, namespaces, and final classes
- Symfony Console integration for a clean CLI

Generator settings
------------------

[](#generator-settings)

All settings of entities and data form can be found in Options.php

Notes
-----

[](#notes)

- Designed for Nette Framework projects.
- CLI binary expects a project with app/Bootstrap.php.
- For non-Nette projects, a custom bootstrap is required.

###  Health Score

56

—

FairBetter than 97% of packages

Maintenance96

Actively maintained with recent releases

Popularity17

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity84

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~83 days

Recently: every ~107 days

Total

30

Last Release

30d ago

PHP version history (6 changes)v1.0.0PHP &gt;=7.2

v1.0.10PHP &gt;=7.4

v1.0.20PHP &gt;=8.0

v1.0.26PHP &gt;=8.1

v1.0.30PHP &gt;=8.1 &lt;8.4

v1.0.32PHP &gt;=8.3 &lt;9

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5998929?v=4)[Zdeněk Papučík](/maintainers/accgit)[@accgit](https://github.com/accgit)

---

Top Contributors

[![accgit](https://avatars.githubusercontent.com/u/5998929?v=4)](https://github.com/accgit "accgit (516 commits)")

---

Tags

consoleentitygeneratornette

### Embed Badge

![Health badge](/badges/drago-ex-generator/health.svg)

```
[![Health](https://phpackages.com/badges/drago-ex-generator/health.svg)](https://phpackages.com/packages/drago-ex-generator)
```

###  Alternatives

[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[laravel/framework

The Laravel Framework.

34.8k543.8M20.1k](/packages/laravel-framework)[api-platform/core

Build a fully-featured hypermedia or GraphQL API in minutes!

2.6k51.2M338](/packages/api-platform-core)[spiral/framework

Spiral, High-Performance PHP/Go Framework

2.1k2.2M66](/packages/spiral-framework)[illuminate/support

The Illuminate Support package.

630113.0M41.3k](/packages/illuminate-support)[api-platform/metadata

API Resource-oriented metadata attributes and factories

275.0M218](/packages/api-platform-metadata)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
