Monday, April 25, 2011

Using th native MySQL ENUM type in Symfony 1.4 and Doctrine

from: http://imanpage.com/code/using-th-native-mysql-enum-type-symfony-14-and-doctrine

To use the native MySQL ENUM type in Symfony and Doctrine you will have to update your "project/config/databases.yml" and add the "use_native_enum" directive under "attributes" i.e: 
      attributes:      
         use_native_enum: true
         use_dql_callbacks: true
         default_table_collate: utf8_general_ci
         default_table_charset: utf8

Full Version

all:
  doctrine:
    class: sfDoctrineDatabase
    param:
      dsn: 'mysql:host=localhost;dbname=mydb_prod'
      username: root
      password: 12345
      attributes:                
         use_native_enum: true
         use_dql_callbacks: true
         default_table_collate: utf8_general_ci
         default_table_charset: utf8

Thanks Iman! =)

Thursday, March 24, 2011

Getting Raw Data from Action to Template

Thanks Stéphane of Google Groups

In a template, you can call $sf_data->getRaw('myActionProperty');
after init it like $this->myActionProperty = array('hey'=>'hoy'); inside an
action.
So you'll get your raw object : unescaped.

Wednesday, March 23, 2011

Clean Everything

php symfony doctrine:build --all-classes --sql
php symfony doctrine:migrate
php symfony plugin:publish-assets
php symfony cc

Creating User Account

php symfony guard:create-user lj regalado

php symfony guard:promote lj

Thursday, March 17, 2011

Symfony admin generator: problems with routing and multiple primary keys

Got the solution from: Symfony admin generator: problems with routing and multiple primary keys

You can easily solve this issue by entering a complex rule using the very same primary keys you defined in your schema.yml. Assuming the “myModule” model has two primary keys “myKey1″ and “myKey2″, you can change your route like the following
column: myKey1/:myKey2
here you go: solved!
Thanks bit2bit.it, whoever you are.. ;)

Symfony Admin Gen

./symfony doctrine:generate-admin backend JobeetCategory --module=category

Thursday, March 10, 2011