0

I am essentially looking to combine these two commands:

php bin/console doctrine:generate:entity --entity="BundleName:EntitiyName" --fields="fieldName:fieldType"

php bin/console doctrine:schema:update --force

I know I could write a script or simply chain the commands but I was wondering if Symfony provides an inbuilt solution.

I am using Symfony 3.3.

Bananaapple
  • 2,984
  • 2
  • 25
  • 38
  • 1
    i don't think so – t-n-y Aug 11 '17 at 14:29
  • you can check this: https://stackoverflow.com/questions/41319602/run-multiple-symfony-console-commands-from-within-a-command. – Albeis Aug 11 '17 at 14:34
  • @Albeis - that would do the trick but if that's the only way I'd be better off with a shell script so I don't have to redeploy that custom snippet each time – Bananaapple Aug 11 '17 at 14:37

1 Answers1

0

So after looking into this some more this does not seem to be possible.

To work around this I created a batch script called tentity (table and entity), which I then added to my path:

@echo off
php .\bin\console doctrine:generate:entity %*
php .\bin\console doctrine:schema:update --force

Now I can simply do:

tentity --entity="BundleName:EntitiyName" --fields="fieldName:fieldType"

Bananaapple
  • 2,984
  • 2
  • 25
  • 38