class ScalarDummy

Hierarchy

Expanded class hierarchy of ScalarDummy

2 files declare their use of ScalarDummy
CustomNormalizerTest.php in drupal/core/vendor/symfony/serializer/Symfony/Component/Serializer/Tests/Normalizer/CustomNormalizerTest.php
XmlEncoderTest.php in drupal/core/vendor/symfony/serializer/Symfony/Component/Serializer/Tests/Encoder/XmlEncoderTest.php

File

drupal/core/vendor/symfony/serializer/Symfony/Component/Serializer/Tests/Fixtures/ScalarDummy.php, line 19

Namespace

Symfony\Component\Serializer\Tests\Fixtures
View source
class ScalarDummy implements NormalizableInterface, DenormalizableInterface {
  public $foo;
  public $xmlFoo;
  public function normalize(NormalizerInterface $normalizer, $format = null) {
    return $format === 'xml' ? $this->xmlFoo : $this->foo;
  }
  public function denormalize(DenormalizerInterface $denormalizer, $data, $format = null) {
    if ($format === 'xml') {
      $this->xmlFoo = $data;
    }
    else {
      $this->foo = $data;
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ScalarDummy::$foo public property
ScalarDummy::$xmlFoo public property
ScalarDummy::denormalize public function Denormalizes the object back from an array of scalars|arrays. Overrides DenormalizableInterface::denormalize
ScalarDummy::normalize public function Normalizes the object into an array of scalars|arrays. Overrides NormalizableInterface::normalize