コード例 #1
0
 public function denormalize($data, $class, $format = null, array $context = [])
 {
     if (empty($data)) {
         return null;
     }
     if (isset($data->{'$ref'})) {
         return new Reference($data->{'$ref'}, $context['rootSchema'] ?: null);
     }
     $object = new \Docker\API\Model\ExecConfig();
     if (!isset($context['rootSchema'])) {
         $context['rootSchema'] = $object;
     }
     if (isset($data->{'AttachStdin'})) {
         $object->setAttachStdin($data->{'AttachStdin'});
     }
     if (isset($data->{'AttachStdout'})) {
         $object->setAttachStdout($data->{'AttachStdout'});
     }
     if (isset($data->{'AttachStderr'})) {
         $object->setAttachStderr($data->{'AttachStderr'});
     }
     if (isset($data->{'Tty'})) {
         $object->setTty($data->{'Tty'});
     }
     if (isset($data->{'Cmd'})) {
         $values_179 = [];
         foreach ($data->{'Cmd'} as $value_180) {
             $values_179[] = $value_180;
         }
         $object->setCmd($values_179);
     }
     return $object;
 }
コード例 #2
0
 public function denormalize($data, $class, $format = null, array $context = [])
 {
     if (empty($data)) {
         return null;
     }
     if (isset($data->{'$ref'})) {
         return new Reference($data->{'$ref'}, $context['rootSchema'] ?: null);
     }
     $object = new \Docker\API\Model\ExecConfig();
     if (!isset($context['rootSchema'])) {
         $context['rootSchema'] = $object;
     }
     if (property_exists($data, 'AttachStdin')) {
         $object->setAttachStdin($data->{'AttachStdin'});
     }
     if (property_exists($data, 'AttachStdout')) {
         $object->setAttachStdout($data->{'AttachStdout'});
     }
     if (property_exists($data, 'AttachStderr')) {
         $object->setAttachStderr($data->{'AttachStderr'});
     }
     if (property_exists($data, 'Tty')) {
         $object->setTty($data->{'Tty'});
     }
     if (property_exists($data, 'Cmd')) {
         $value = $data->{'Cmd'};
         if (is_array($data->{'Cmd'})) {
             $values = [];
             foreach ($data->{'Cmd'} as $value_1) {
                 $values[] = $value_1;
             }
             $value = $values;
         }
         if (is_null($data->{'Cmd'})) {
             $value = $data->{'Cmd'};
         }
         $object->setCmd($value);
     }
     return $object;
 }