Last active
March 1, 2017 00:13
-
-
Save putWorkDev/2005ed1531ee81f3edcc to your computer and use it in GitHub Desktop.
Tips symfony cli
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Once the metadata files are generated, you can ask Doctrine to build related entity classes by executing the following two commands: | |
php app/console doctrine:generate:entities CoreUserBundle |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Check if database is already in sync with the current entity metadata: | |
php app/console doctrine:schema:update --dump-sql |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Create tables in db: | |
php app/console doctrine:schema:update --force |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You now have a usable Product class with mapping information so that Doctrine | |
knows exactly how to persist it. Of course, you don't yet have the | |
corresponding product table in your database. Fortunately, Doctrine can | |
automatically create all the database tables needed for every known entity | |
in your application. To do this, run: | |
php app/console doctrine:schema:update --force | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment