Search code examples
objectsymfony1doctrinerecord

symfony adding widgets to sfFormObject


I have a form class SomeForm extends MyObjectForm

MyObjectForm is a sfFormObject form of the object MyObject.

I want to add a widget named extra to SomeForm but that's not a field of the object MyObject, and when i try to save the form i get an error:

500 | Internal Server Error | Doctrine_Record_UnknownPropertyException
Unknown record property / related component "extra" on "MyObject"

Solution

  • Try unsetting it in SomeForm::processValues()

    public function processValues($values) {
        unset($values['extra']);
        return $values;
    }