コード例 #1
0
 /**
  * @param $data
  * @param Tx_PtExtlist_Domain_Configuration_Columns_ObjectMapper_ObjectMapperConfig $configuration
  * @return object
  */
 public function convert($data, $configuration)
 {
     if ($configuration->getMapping()) {
         $this->applyKeyMapping($configuration->getMapping(), $data);
     }
     $mappedObject = $this->mapper->map(array(), $data, $configuration->getClass());
     if ($mappedObject === NULL) {
         throw new Exception('The data could mot be mapped to the object of class' . $configuration->getClass() . '. Reason: ' . implode(', ', $this->mapper->getMappingResults()->getErrors()));
     }
     return $mappedObject;
 }
コード例 #2
0
 /**
  * Maps arguments delivered by the request object to the local controller arguments.
  *
  * @return void
  */
 protected function mapRequestArgumentsToControllerArguments()
 {
     $optionalPropertyNames = array();
     $allPropertyNames = $this->arguments->getArgumentNames();
     foreach ($allPropertyNames as $propertyName) {
         if ($this->arguments[$propertyName]->isRequired() === FALSE) {
             $optionalPropertyNames[] = $propertyName;
         }
     }
     $validator = t3lib_div::makeInstance('Tx_Extbase_MVC_Controller_ArgumentsValidator');
     $this->propertyMapper->mapAndValidate($allPropertyNames, $this->request->getArguments(), $this->arguments, $optionalPropertyNames, $validator);
     $this->argumentsMappingResults = $this->propertyMapper->getMappingResults();
 }