SOLUTION: symfony 1.4 doctrine:generate-module error: The "xxxForm" form only accepts a "xxx" object

When trying to execute php symfony doctrine:generate-module frontend account Account I only got the following error (verbose output is at the end of this post.)

The "AccountForm" form only accepts a "Account" object.

This was driving me nuts. As it turns out it was all caused because I had a table named "form" in my database. Apparently this causes a classname conflict after code generation.

I revised my schema.yml to rename form to input_form and Form to InputForm.

Then, I ran php symfony doctrine:clean-model-files to remove the orphan files.

After this, doctrine:generate-model worked!

Hope this helps someone out there.

C:\xampp\websites\mail2action>php symfony doctrine:generate-module frontend account Account

  The "AccountForm" form only accepts a "Account" object.

[ ?php use_stylesheets_for_form($form) ?]
[ ?php use_javascripts_for_form($form) ?]

Strict standards: Declaration of sfFormObject::save() should be compatible with
that of Doctrine_Record::save() in C:\xampp\websites\mail2action\lib\vendor\symf
ony\lib\form\addon\sfFormObject.class.php on line 20

Call Stack:
    0.0004     324328   1. {main}() C:\xampp\websites\mail2action\symfony:0
    0.0065     584464   2. include('C:\xampp\websites\mail2action\lib\vendor\sym
fony\lib\command\cli.php') C:\xampp\websites\mail2action\symfony:14

[...]

    0.7507   10949504  26. require('C:\xampp\websites\mail2action\lib\vendor\sym
fony\lib\form\addon\sfFormObject.class.php') C:\xampp\websites\mail2action\lib\v
endor\symfony\lib\autoload\sfCoreAutoload.class.php:99


Fatal error: Call to a member function evictAll() on a non-object in C:\xampp\we
bsites\mail2action\lib\vendor\symfony\lib\plugins\sfDoctrinePlugin\lib\vendor\do
ctrine\Doctrine\Connection.php on line 1239

Call Stack:
    0.0004     324328   1. {main}() C:\xampp\websites\mail2action\symfony:0
    0.0065     584464   2. include('C:\xampp\websites\mail2action\lib\vendor\sym
fony\lib\command\cli.php') C:\xampp\websites\mail2action\symfony:14

[...]

    1.0737   11917472   7. Doctrine_Connection->clear() C:\xampp\websites\mail2a
ction\lib\vendor\symfony\lib\plugins\sfDoctrinePlugin\lib\vendor\doctrine\Doctri
ne\Connection.php:1268