コード例 #1
0
ファイル: Mapper.php プロジェクト: scriptfusion/mapper
 /**
  * @param array $record Record.
  * @param Mapping $mapping Mapping.
  * @param mixed $context Contextual data.
  *
  * @return array Mapped record.
  *
  * @throws \Exception
  */
 protected function mapMapping(array $record, Mapping $mapping, $context = null)
 {
     $mapped = $this->mapFragment($record, $mapping->toArray(), $context);
     if ($mapping->isWrapped()) {
         // Unwrap.
         return $mapped[0];
     }
     return $mapped;
 }
コード例 #2
0
 /**
  * @param array|Strategy $definition
  */
 public function __construct($definition)
 {
     $this->definition = $definition;
     parent::__construct();
 }