/**
  * {@inheritdoc}
  */
 public function visit(CommandInterface $command, Response $response, Parameter $param, &$value, $context = null)
 {
     // check if there's an embedded resource for the parameter's
     // "wire" name
     $resources = $this->get($command, 'embedded');
     if (!empty($resources[$param->getWireName()])) {
         // create a model representing the embedded resource data
         $embeddedModel = $this->builder->createEmbeddedModel($command, $param, $resources[$param->getWireName()]);
         // store the created embedded model in the results array
         $value[self::ELEMENT][$param->getName()] = $embeddedModel;
     }
 }
示例#2
0
 /**
  * {@inheritdoc}
  */
 protected function createResourceFromData(CommandInterface $command, Parameter $structure, array $data)
 {
     return $this->builder->createEmbeddedModel($command, $structure, $data);
 }