PersonSecretMoreVirtual.php 573 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace JMS\Serializer\Tests\Fixtures;
  3. use JMS\Serializer\Annotation as Serializer;
  4. /**
  5. * @Serializer\ExclusionPolicy("ALL")
  6. * @Serializer\AccessorOrder("custom",custom = {"name", "gender"})
  7. */
  8. class PersonSecretMoreVirtual
  9. {
  10. /**
  11. * @Serializer\Type("string")
  12. * @Serializer\Expose()
  13. */
  14. public $name;
  15. public $gender;
  16. /**
  17. * @Serializer\VirtualProperty()
  18. * @Serializer\Type("string")
  19. * @Serializer\Expose(if="show_data('gender')")
  20. */
  21. public function getGender()
  22. {
  23. return $this->gender;
  24. }
  25. }