2017 © Pedro PelĂĄez
 

library user-command-line

Manage users via Symfony Console and Doctrine ORM on command line

image

heavenproject/user-command-line

Manage users via Symfony Console and Doctrine ORM on command line

  • Thursday, March 9, 2017
  • by heavenproject
  • Repository
  • 1 Watchers
  • 0 Stars
  • 518 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

User Command Line

Manage users via Symfony Console and Doctrine ORM on command line., (*1)

Installation

composer require heavenproject/user-command-line, (*2)

Requirements

Documentation

In order for the hproj:create-user (or hproj:create:user as alias) command to work correctly a small update in your application code is required., (*3)

Because we work with users here, there has to be some user entity in your application. This entity must implement the UserEntityInterface. ThatÂŽs all., (*4)

You have many options how to do this. You can implement the entire interface yourself if your need some custom logic but this library contains some bits of pieces of code among which there are UserMethods and UserProperties both of which are combined in one single UserTrait. These might help you with the implementation., (*5)

If you need more info on how to use the above command, use your Symfony Console in your command line the way that you are used to (in Nette it is php www/index.php) and type help hproj:create-user (eg: php www/index.php help hproj:create-user)., (*6)

Example 1

namespace App\Model\Entities;

use Doctrine\ORM\Mapping as ORM;
use HeavenProject\UserCommandLine\UserTrait;
use HeavenProject\UserCommandLine\UserEntityInterface;

/**
 * @ORM\Entity
 * @ORM\Table(name="`user`")
 */
class UserEntity implements UserEntityInterface
{
    use UserTrait;
}

Example 2

namespace App\Model\Entities;

use Doctrine\ORM\Mapping as ORM;
use HeavenProject\UserCommandLine\UserMethods;
use HeavenProject\UserCommandLine\UserEntityInterface;

/**
 * @ORM\Entity
 * @ORM\Table(name="`user`")
 */
class UserEntity implements UserEntityInterface
{
    use UserMethods;

    // Your properties
}

Example 3

namespace App\Model\Entities;

use Doctrine\ORM\Mapping as ORM;
use HeavenProject\UserCommandLine\UserProperties;
use HeavenProject\UserCommandLine\UserEntityInterface;

/**
 * @ORM\Entity
 * @ORM\Table(name="`user`")
 */
class UserEntity implements UserEntityInterface
{
    use UserProperties;

    // Your methods
}

Example 4

namespace App\Model\Entities;

use Doctrine\ORM\Mapping as ORM;
use HeavenProject\UserCommandLine\UserEntityInterface;

/**
 * @ORM\Entity
 * @ORM\Table(name="`user`")
 */
class UserEntity implements UserEntityInterface
{
    // Your entire own implementation of properties and methods
}

You can of course add more properties and methods in your entity if you wish., (*7)

Config

Register the UserCommandLineExtension in your application neon config and to this extension provide the targetEntity which is your updated user entity (class name together with namespace)., (*8)

extensions:
    userCommandLine: HeavenProject\UserCommandLine\UserCommandLineExtension

userCommandLine:
    targetEntity: App\Model\Entities\UserEntity

License

This source code is free software available under the MIT license., (*9)

The Versions

09/03 2017

dev-master

9999999-dev https://github.com/CSHH/user-command-line

Manage users via Symfony Console and Doctrine ORM on command line

  Sources   Download

MIT

The Requires

 

The Development Requires

by Community of volunteers

command line doctrine users symfony console doctrine orm user command line kdyby console kdyby doctrine kdyby doctrine orm

09/03 2017

v1.1.0

1.1.0.0 https://github.com/CSHH/user-command-line

Manage users via Symfony Console and Doctrine ORM on command line

  Sources   Download

MIT

The Requires

 

The Development Requires

by Community of volunteers

command line doctrine users symfony console doctrine orm user command line kdyby console kdyby doctrine kdyby doctrine orm

05/09 2016

v1.0.1

1.0.1.0 https://github.com/CSHH/user-command-line

Manage users via Symfony Console and Doctrine ORM on command line

  Sources   Download

MIT

The Requires

 

The Development Requires

by Community of volunteers

command line doctrine users symfony console doctrine orm user command line kdyby console kdyby doctrine kdyby doctrine orm

03/05 2016

v1.0.0

1.0.0.0 https://github.com/CSHH/user-command-line

Manage users via Symfony Console and Doctrine ORM on command line

  Sources   Download

MIT

The Requires

 

The Development Requires

by Community of volunteers

command line doctrine users symfony console doctrine orm user command line kdyby console kdyby doctrine kdyby doctrine orm