ParentSkipWithEmptyChild.php 383 B

1234567891011121314151617181920212223
  1. <?php
  2. namespace JMS\Serializer\Tests\Fixtures;
  3. use JMS\Serializer\Annotation as Serializer;
  4. class ParentSkipWithEmptyChild
  5. {
  6. private $c = 'c';
  7. private $d = 'd';
  8. /**
  9. * @Serializer\SkipWhenEmpty()
  10. * @var InlineChild
  11. */
  12. private $child;
  13. public function __construct($child = null)
  14. {
  15. $this->child = $child ?: new InlineChild();
  16. }
  17. }