**/ public function updateEmployeeFromRequest() { parent::updateEmployeeFromRequest(); $request = $this->getRequest(); // create the slug $slug = strtolower(preg_replace("/\W+/", "", $this->employee->getName())); $this->employee->setSlug($slug); // save the titles which are also internationalized foreach($request->getParameter('title') as $culture => $value) { $this->employee->setCulture($culture); $this->employee->setTitle($value); } // save the biographies as we also use a custom template for them foreach($request->getParameter('biography') as $culture => $value) { $this->employee->setCulture($culture); $this->employee->setBiography($value); } // save the picture as we use a custom template for it if($request->hasFiles()) { foreach($request->getFileNames() as $fileName) { if($request->getFileSize($fileName) <= 0) continue; $employeeImagePath = sfConfig::get('sf_web_dir').'/images/whoarewe/employees'; $pictureName = str_replace(" ", "", $this->employee->getName()) . $request->getFileExtension($fileName); $request->moveFile($fileName, $employeeImagePath.'/'.$pictureName); // resize the image to the standard size $image = new phMagick($employeeImagePath.'/'.$pictureName); $image->setDestination($employeeImagePath.'/'.$pictureName); $image->resize(200, 0); // create the thumbnail image $thumbnail = $image; $thumbnail->setDestination($employeeImagePath.'/thumb_'.$pictureName); $thumbnail->resize(70,0); // save the image name in the employee $this->employee->setPicture($pictureName); } } } }