0

I have a Collection Form

class MyCollectionForm extends sfForm
{
  public function configure()
  {
    parent::configure();

    $this->widgetSchema->setNameFormat('my_collection[%s]');

    $groups = Doctrine::getTable('QuotaGroup')->findAll(); //existing groups
    foreach ($groups as $i => $group)
    {
        $groupForm = new QuotaGroupForm($group);
        $this->embedForm($i, $groupForm);
    }

    $i++;
    $this->embedForm($i, new QuotaGroupForm(new QuotaGroup())); //new group

    $this->mergePostValidator(new QuotaGroupValidatorSchema());
  }
}

In the Save Action I do:

$this->form->bind($params);
if($this->form->isValid())
{
   $this->form->save();
}

I get an error: Call to undefined method MyCollectionForm::save()

I cant´t find the error because sfForm has a save method...

2
  • Wow, this is really strange! Could you check whether MyCollectionForm instanceof sfForm? Did you use copy/paste for everything in your question (including the error message?) Commented Jul 23, 2011 at 22:47
  • Not about embedded programming. Retagged. Commented Jul 25, 2011 at 7:16

1 Answer 1

1

sfForm does not have a save method...

You should extend sfFormDoctrine.

class MyCollectionForm extends sfFormDoctrine{ ...
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.