**/ public function updateEventFromRequest() { parent::updateEventFromRequest(); $request = $this->getRequest(); // save the titles foreach($request->getParameter('title') as $culture => $value) { $this->event->setCulture($culture); $this->event->setTitle($value); } // save the descriptions foreach($request->getParameter('description') as $culture => $value) { $this->event->setCulture($culture); $this->event->setDescription($value); } // save the event picture if($request->hasFiles()) { foreach($request->getFileNames() as $fileName) { if($request->getFileSize($fileName) <= 0) continue; $eventImagePath = sfConfig::get('sf_web_dir').'/images/events'; $pictureName = preg_replace("/\W/", "", $this->event->getTitle()) . $request->getFileExtension($fileName); $request->moveFile($fileName, $eventImagePath.'/'.$pictureName); // resize the image to the standard size $image = new phMagick($eventImagePath.'/'.$pictureName); $image->setDestination($eventImagePath.'/'.$pictureName); $image->resize(400, 0); // create the thumbnail image $thumbnail = $image; $thumbnail->setDestination($eventImagePath.'/thumb_'.$pictureName); $thumbnail->resize(70,0); // save the image name in the employee $this->event->setPicture($pictureName); } } } }