<?php

namespace SmartCAT\Client\Normalizer;

use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
use Symfony\Component\Serializer\Normalizer\SerializerAwareNormalizer;

class DisassembleSettingsModelNormalizer extends SerializerAwareNormalizer implements DenormalizerInterface, NormalizerInterface
{
    public function supportsDenormalization($data, $type, $format = null)
    {
        if ($type !== 'SmartCAT\\Client\\Model\\DisassembleSettingsModel') {
            return false;
        }
        return true;
    }
    public function supportsNormalization($data, $format = null)
    {
        if ($data instanceof \SmartCAT\Client\Model\DisassembleSettingsModel) {
            return true;
        }
        return false;
    }
    public function denormalize($data, $class, $format = null, array $context = array())
    {
        $object = new \SmartCAT\Client\Model\DisassembleSettingsModel();
        if (property_exists($data, 'translatableAttributes')) {
            $object->setTranslatableAttributes($data->{'translatableAttributes'});
        }
        return $object;
    }
    public function normalize($object, $format = null, array $context = array())
    {
        $data = new \stdClass();
        if (null !== $object->getTranslatableAttributes()) {
            $data->{'translatableAttributes'} = $object->getTranslatableAttributes();
        }
        return $data;
    }
}