Dummy.php 800 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace Symfony\Tests\Component\Serializer\Fixtures;
  3. use Symfony\Component\Serializer\Normalizer\NormalizableInterface;
  4. use Symfony\Component\Serializer\SerializerInterface;
  5. class Dummy implements NormalizableInterface
  6. {
  7. public $foo;
  8. public $bar;
  9. public $baz;
  10. public $qux;
  11. public function normalize(SerializerInterface $serializer, $format = null)
  12. {
  13. return array(
  14. 'foo' => $this->foo,
  15. 'bar' => $this->bar,
  16. 'baz' => $this->baz,
  17. 'qux' => $this->qux,
  18. );
  19. }
  20. public function denormalize(SerializerInterface $serializer, $data, $format = null)
  21. {
  22. $this->foo = $data['foo'];
  23. $this->bar = $data['bar'];
  24. $this->baz = $data['baz'];
  25. $this->qux = $data['qux'];
  26. }
  27. }