GetSetObject.php 587 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace JMS\SerializerBundle\Tests\Fixtures;
  3. use JMS\SerializerBundle\Annotation\AccessType;
  4. use JMS\SerializerBundle\Annotation\Type;
  5. /** @AccessType("public_method") */
  6. class GetSetObject
  7. {
  8. /** @AccessType("property") @Type("integer") */
  9. private $id = 1;
  10. /** @Type("string") */
  11. private $name = 'Foo';
  12. public function getId()
  13. {
  14. throw new \RuntimeException('This should not be called.');
  15. }
  16. public function getName()
  17. {
  18. return 'Johannes';
  19. }
  20. public function setName($name)
  21. {
  22. $this->name = $name;
  23. }
  24. }