views:

16

answers:

1

When using Doctrine::generateYamlFromDb(), can I specify a prefix to use?

For example, if the table name is "user", by default, the generated class name would be "User". Can I make sure the class name (and filename) is "PrefixUser"?

A: 
//Doctrine_Core::generateYamlFromDb($yamlPath, array $connections = array(), array $options = array())

Doctrine_Core::generateYamlFromDb(
    'schema.yml',
    array(), // will use the default connection
    array( // the $options array
      'classPrefix'=>'Prefix',
      'classPrefixFiles'=>true
    )
);

not tested :D

dgaspar