Created
October 20, 2014 15:00
-
-
Save joseluisq/43c9d8032cbd2fe688d3 to your computer and use it in GitHub Desktop.
Linux shell script to generate entities for PHP Doctrine 2
This file contains 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
#!/bin/sh | |
# Doctrine 2 Entities Generator v0.1 | |
# ================================== | |
# Requirements | |
# ============ | |
# It's necessary to create a composer project before exec this script. | |
# More info about composer at https://getcomposer.org/doc/00-intro.md | |
echo Doctrine 2 Entities Generator v0.1 | |
echo ================================== | |
# Remove ./config/yaml directory before | |
rm -rf ./config/yaml | |
# Create yaml directory | |
mkdir ./config/yaml | |
# Read the ./cli-config.php (by default) and generate mapping yaml files to ./config/yaml directory | |
php vendor/bin/doctrine orm:convert-mapping --namespace="" --force --from-database yml ./config/yaml | |
# Generated models to ./src directory | |
php vendor/bin/doctrine orm:generate-entities --generate-annotations=false --update-entities=true --generate-methods=false ./src | |
# Validate schema | |
php vendor/bin/doctrine orm:validate-schema |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment