Skip to content

Instantly share code, notes, and snippets.

@daanraman
Last active December 22, 2015 01:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daanraman/6398218 to your computer and use it in GitHub Desktop.
Save daanraman/6398218 to your computer and use it in GitHub Desktop.
Doctrine Cheat Sheet
=============INSTALL DOCTRINE IN CI=============
1. Copy Doctrine/ and Doctrine.php into application/libraries
2. Create folders Entities/ Proxies/ Mappings/ in models
3. Copy doctrine-cli.php into application/
=============NEW ENTITIES=============
1. Generate entities from descritions in YAML files:
----------------------------------------------------
php doctrine-cli.php orm:generate-entities models
2. Generate Proxy files:
------------------------
php doctrine-cli.php orm:generate-proxies
3. If database is not empty:
-----------------------------
php doctrine-cli.php orm:schema-tool:drop --force
4. Create database tables:
--------------------------
php doctrine-cli.php orm:schema-tool:create
=============UPDATE ENTITIES=============
1. Generate entities from descritions in YAML files:
----------------------------------------------------
php doctrine-cli.php orm:generate-entities models
2. Generate Proxy files:
------------------------
php doctrine-cli.php orm:generate-proxies
3. Update entities
------------------
php doctrine-cli.php orm:schema-tool:update --force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment