You are here

class ScalarDummy in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/serializer/Tests/Fixtures/ScalarDummy.php \Symfony\Component\Serializer\Tests\Fixtures\ScalarDummy

Hierarchy

Expanded class hierarchy of ScalarDummy

2 files declare their use of ScalarDummy
CustomNormalizerTest.php in vendor/symfony/serializer/Tests/Normalizer/CustomNormalizerTest.php
XmlEncoderTest.php in vendor/symfony/serializer/Tests/Encoder/XmlEncoderTest.php

File

vendor/symfony/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, array $context = array()) {
    return $format === 'xml' ? $this->xmlFoo : $this->foo;
  }
  public function denormalize(DenormalizerInterface $denormalizer, $data, $format = null, array $context = array()) {
    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