public function executeNew(sfWebRequest $request)
{
$this->form = new JobeetJobForm();
}
public function executeCreate(sfWebRequest $request)
{
$this->forward404Unless($request->isMethod('post'));
$this->form = new JobeetJobForm();
$this->processForm($request, $this->form);
$this->setTemplate('new');
}
protected function processForm(sfWebRequest $request, sfForm $form)
{
$form->bind($request->getParameter($form->getName()));
if ($form->isValid())
{
$jobeet_job = $form->save();
$this->redirect('job/edit?id='.$jobeet_job['id']);
}
}
I generated module with doctrine generator. I would like make: if i edit current Job and click Save then instead of save this edit i would like create new object job with new ID and same data as current edited Job. How can i make it? I would like make this same as wikipedia.
EDIT:
i dont know how to open action edit, edit few fields and click Save and instead save this changes i would like create new object. What i must edit in processForm?
This is exactly the goal of the versionable behavior of Doctrine.