I have form which has couple fields which user should fill, but three fields are hidden: created_at, updated_at, and created_by.
I want to update those fields after user subbmit the form, but I have no idea how.
I tried something like this, but still not works;
public function executeCreate(sfWebRequest $request)
{
$user = $this->getUser();
$entity = new ProdPProcessIdentifyMethod(); //instance of object which form is about
$entity->setDescription($request->getPostParameter('description'));
$entity->setName($request->getPostParameter('name'));
$entity->setNumber($request->getPostParameter('number'));
$entity->setMarkingsDescription($request->getPostParameter('markings_description'));
$entity->setRegistrationPurpose($request->getAttribute('registration_purpose'));
$entity->setRegistry($request->getPostParameter('registry'));
$entity->setCreatedAt(new DateTime());
$entity->setUpdatedAt(new DateTime());
$entity->setCreatedBy($user->getId());
$entity->setUpdatedBy($user->getId());
$this->form = new ProdPProcessIdentifyMethodForm($entity); //passing object which has values I need
$this->ProdPProcessIdentifyMethod = $this->form->getObject();
$this->processForm($request, $this->form);
$this->setTemplate('new');
}