TplBlock/vendor/jms/serializer/tests/Metadata/Driver/php/PersonSecret.php
2018-03-26 21:57:35 +02:00

23 lines
783 B
PHP

<?php
use JMS\Serializer\Metadata\ClassMetadata;
use JMS\Serializer\Metadata\PropertyMetadata;
$metadata = new ClassMetadata('JMS\Serializer\Tests\Fixtures\PersonSecret');
$pMetadata = new PropertyMetadata('JMS\Serializer\Tests\Fixtures\PersonSecret', 'name');
$pMetadata->setType('string');
$metadata->addPropertyMetadata($pMetadata);
$pMetadata = new PropertyMetadata('JMS\Serializer\Tests\Fixtures\PersonSecret', 'gender');
$pMetadata->setType('string');
$pMetadata->excludeIf = "show_data('gender')";
$metadata->addPropertyMetadata($pMetadata);
$pMetadata = new PropertyMetadata('JMS\Serializer\Tests\Fixtures\PersonSecret', 'age');
$pMetadata->setType('string');
$pMetadata->excludeIf = "!(show_data('age'))";
$metadata->addPropertyMetadata($pMetadata);
return $metadata;