Code snippets for symfony 1.x

Navigation

Refine Tags

Snippets tagged "doctrine model"

script for to generate (all) modules

This Bash script transform: 'BaseModel.class.php' => 'BaseModel' => 'Model' then call doctrine:generate-admin frontend 'Model', for all files from lib/model/doctrine/base.

#!/bin/bash
for file_class in `ls lib/model/doctrine/base`  do
    base_model=${file_class/%.class.php/}      
    model=${base_model/#Base/}                 
    ./symfony doctrine:generate-admin --env="prod" frontend $model
done
 
by Vlad Bazon on 2010-08-01, tagged bash  doctrine  generateadmin  model  modul  symfony 

Doctrine-build-all(-load) workaround

It's very annoying that the pake tasks @doctrine-build-all@ and @doctrine-build-all-load@ don't work. So I've thought, why don't write a shell script which executes the single steps for me.

Just create a new file in your batch directory. For example 'build' or 'doctrine'

#!/usr/bin/env bash
 
symfony doctrine-drop-db <your app>
symfony doctrine-build-db <your app>
symfony doctrine-build-model <your app>
symfony doctrine-build-sql <your app>
symfony doctrine-insert-sql <your app>
 
php batch/<your load-data-batch-file>.php
by Halil Köklü on 2007-07-25, tagged batch  doctrine  model