I'm having a problem when I try to save the form's information into the database. My form doesn't seem to be valid, even after manually setting the Theater's id for every theater in the chosen Network. Here's the related part of my module's actions.class.php :
Here's executeCreate():
public function executeCreate(sfWebRequest $request) {
$this->form = $this->configuration->getForm();
$this->showing = $this->form->getObject();
$this->processCreateForm($request, $this->form);
$this->setTemplate('new');
}
and now processCreateForm():
protected function processCreateForm(sfWebRequest $request, sfForm $form) {
$form->bind($request->getParameter($form->getName()), $request->getFiles($form->getName()));
$form_name = $form->getName();
$parameters = $request->getParameter($form_name);
$network_id = $parameters['network_id'];
$theaters_list = Doctrine_Query::create()
[...]
->execute();
foreach ($theaters_list as $theater) {
$form->getObject()->setTheaterId($theater->theater_id);
$form->bind($request->getParameter($form->getName()), $request->getFiles($form->getName()));
if ($form->isValid()) {
$showing = $form->save();
} else {
foreach ($form->getErrorSchema()->getErrors() as $key => $error) {
echo '<p>' . $key . ': ' . $error . '</p>';
}
}
}
$this->getUser()->setFlash('update_success', true);
$this->setTemplate('new');
}
Here's the output :
Thank you for your help