Skip to content

Instantly share code, notes, and snippets.

@oskarcalvo
Created September 7, 2016 16:19
Show Gist options
  • Save oskarcalvo/a933815fb51605cdc38f748300d52e23 to your computer and use it in GitHub Desktop.
Save oskarcalvo/a933815fb51605cdc38f748300d52e23 to your computer and use it in GitHub Desktop.
oskar@workStation ~/.../curso $ php app/console doctrine:generate:entity
Welcome to the Doctrine2 entity generator
This command helps you generate Doctrine2 entities.
First, you need to give the entity name you want to generate.
You must use the shortcut notation like AcmeBlogBundle:Post.
The Entity shortcut name: TCKUserBundle:User
Determine the format to use for the mapping information.
Configuration format (yml, xml, php, or annotation) [annotation]: yml
Instead of starting with a blank entity, you can add some fields now.
Note that the primary key will be added automatically (named id).
Available types: array, simple_array, json_array, object,
boolean, integer, smallint, bigint, string, text, datetime, datetimetz,
date, time, decimal, float, binary, blob, guid.
New field name (press <return> to stop adding fields): username
Field type [string]:
Field length [255]: 50
Is nullable [false]:
Unique [false]:
New field name (press <return> to stop adding fields): first_name
Field type [string]:
Field length [255]: 100
Is nullable [false]:
Unique [false]:
New field name (press <return> to stop adding fields): last_name
Field type [string]:
Field length [255]: 100
Is nullable [false]: true
Unique [false]: false
New field name (press <return> to stop adding fields): email
Field type [string]:
Field length [255]: 100
Is nullable [false]: false
Unique [false]: true
New field name (press <return> to stop adding fields): password
Field type [string]: 100
Invalid type "100".
Field type [string]:
Field length [255]: 100
Is nullable [false]:
Unique [false]:
New field name (press <return> to stop adding fields): role
Field type [string]:
Field length [255]: 50
Is nullable [false]:
Unique [false]:
New field name (press <return> to stop adding fields): is_active
Field type [boolean]:
Is nullable [false]:
Unique [false]:
New field name (press <return> to stop adding fields): created_at
Field type [datetime]:
Is nullable [false]:
Unique [false]:
New field name (press <return> to stop adding fields): updated_at
Field type [datetime]:
Is nullable [false]:
Unique [false]:
New field name (press <return> to stop adding fields):
Entity generation
> Generating entity class src/TCK/UserBundle/Entity/User.php: OK!
> Generating repository class src/TCK/UserBundle/Repository/UserRepository.php: OK!
> Generating mapping file src/TCK/UserBundle/Resources/config/doctrine/User.orm.yml: OK!
Everything is OK! Now get to work :).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment