2017 © Pedro Peláez
 

library nextras-orm-command

Console command for Nextras/ORM

image

barbarossa42/nextras-orm-command

Console command for Nextras/ORM

  • Thursday, July 12, 2018
  • by Barbarossa
  • Repository
  • 1 Watchers
  • 1 Stars
  • 11 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 22 % Grown

The README.md

Nextras/Orm -Console command

composer require barbarossa42/nextras-orm-command

Configuration

Using Kdyby\Console, don´t forget to config file, (*1)

Nette neon config example:, (*2)

console:
    commands:
        - Barbarossa42\NextrasOrmCommand\CreateOrmCommand

Usage

create:orm article Articles\Article articles, (*3)

will generate 3 files in folder Article (into specific directory):, (*4)

Article.php, (*5)

namespace App\Orm\Articles\Article;

use Nextras\Orm\Entity\Entity;

/**
 * Article Entity class
 * @property int $id {primary}
 */
class Article extends Entity
{
}

ArticleRepository.php, (*6)

namespace App\Orm\Articles\Article;

use Nextras\Orm\Repository\Repository;

class ArticleRepository extends Repository
{
    public static function getEntityClassNames(): array
    {
        return [Article::class];
    }
}

ArticleMapper.php, (*7)

namespace App\Orm\Articles\Article;

use Nextras\Orm\Mapper\Mapper;

class ArticleMapper extends Mapper
{
    protected $tableName = 'articles';
}

Command syntax

[0] command name, (*8)

[1] entity name, (*9)

[2] namespace (optional), (*10)

[3] table name (optional), (*11)

Config constants

You can setup your custom extends Parents. For Example custom entity:, (*12)

const NS_ENTITY = 'App\Core\Entity';

The Versions

12/07 2018

dev-master

9999999-dev https://github.com/Seldaek/monolog

Console command for Nextras/ORM

  Sources   Download

MIT

The Requires

 

by Lukáš Prudil

orm command nextras

23/03 2018

v1.0

1.0.0.0 https://github.com/Seldaek/monolog

Console command for Nextras/ORM

  Sources   Download

MIT

The Requires

 

by Lukáš Prudil

orm command nextras