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

21 lines
638 B
PHP

<?php
use JMS\Serializer\Metadata\ClassMetadata;
use JMS\Serializer\Metadata\PropertyMetadata;
$metadata = new ClassMetadata('JMS\Serializer\Tests\Fixtures\Person');
$metadata->xmlRootName = 'child';
$pMetadata = new PropertyMetadata('JMS\Serializer\Tests\Fixtures\Person', 'name');
$pMetadata->setType('string');
$pMetadata->xmlValue = true;
$pMetadata->xmlElementCData = false;
$metadata->addPropertyMetadata($pMetadata);
$pMetadata = new PropertyMetadata('JMS\Serializer\Tests\Fixtures\Person', 'age');
$pMetadata->setType('integer');
$pMetadata->xmlAttribute = true;
$metadata->addPropertyMetadata($pMetadata);
return $metadata;