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\Mount();
if (!isset($context['rootSchema'])) {
$context['rootSchema'] = $object;
}
if (property_exists($data, 'Name')) {
$object->setName($data->{'Name'});
}
if (property_exists($data, 'Source')) {
$object->setSource($data->{'Source'});
}
if (property_exists($data, 'Destination')) {
$object->setDestination($data->{'Destination'});
}
if (property_exists($data, 'Driver')) {
$object->setDriver($data->{'Driver'});
}
if (property_exists($data, 'Mode')) {
$object->setMode($data->{'Mode'});
}
if (property_exists($data, 'RW')) {
$object->setRW($data->{'RW'});
}
if (property_exists($data, 'Propagation')) {
$object->setPropagation($data->{'Propagation'});
}
return $object;
}