delboy1978uk / generator
Generate blank, controller, and db entity package templates for Bone Framework
Installs: 506
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 1
pkg:composer/delboy1978uk/generator
Requires
- php: ^8.1
- ext-json: *
- delboy1978uk/barnacle: ^2.3
- delboy1978uk/bone-console: ^1.4
- delboy1978uk/bone-doctrine: ^1.8
- delboy1978uk/form: ^2.1
- laminas/laminas-diactoros: ^2.1
- laminas/laminas-i18n: ^2.10
- nette/php-generator: ^3.2
Requires (Dev)
- roave/security-advisories: dev-latest
README
Abandoned! Please use https://github.com/boneframework/generator Generate doctrine entities, services, repositories, and forms.
installation
Composer etc.
package generation
$ vendor/bin/generator entity
Entity and Service Generator
Enter the base namespace: Del\Animal
Enter the name of the entity: Unicorn
Create a field? (Y/n)
Enter the name of the field: name
What type of data does it hold? 
  [0] date
  [1] datetime
  [2] decimal
  [3] double
  [4] float
  [5] int
  [6] varchar
  [7] bool
 > 6
What length is the field? 30
Is the field nullable?  (Y/n)
Create another field? (Y/n)
Enter the name of the field: dob
What type of data does it hold? 
  [0] date
  [1] datetime
  [2] decimal
  [3] double
  [4] float
  [5] int
  [6] varchar
  [7] bool
 > 0
Is the field nullable?  (Y/n)
Create another field? (Y/n)
Enter the name of the field: isHungry
What type of data does it hold? 
  [0] date
  [1] datetime
  [2] decimal
  [3] double
  [4] float
  [5] int
  [6] varchar
  [7] bool
 > 7
Is the field nullable?  (Y/n)
Create another field? (Y/n)n
Successfully generated in build/5cd362ce88907.
run db migrations
- copy migrant-cfg.php.distremoving the.distextension, then edit with your db details.
- create a migrations folder
- move the contents of the build folder into srcof your project or package
- edit Package class with the entity path, usually src/Entityorvendor/vendorname/package/src/Entity
vendor/bin/migrant diff
vendor/bin/migrant migrate
usage
If you are using Del\Common, create a Container and add the package. It will be available under the key service.YourEntityName.
If not then create a Doctrine Entity Manager and pass it to the service constructor.