1<?php 2 3declare(strict_types=1); 4 5namespace JMS\Serializer\Tests\Fixtures; 6 7use JMS\Serializer\Annotation\SerializedName; 8use JMS\Serializer\Annotation\Type; 9use JMS\Serializer\Annotation\XmlElement; 10use JMS\Serializer\Annotation\XmlNamespace; 11use JMS\Serializer\Annotation\XmlRoot; 12 13/** 14 * @XmlRoot("publisher") 15 * @XmlNamespace(uri="http://example.com/namespace2", prefix="ns2") 16 */ 17class Publisher 18{ 19 /** 20 * @Type("string") 21 * @XmlElement(namespace="http://example.com/namespace2") 22 * @SerializedName("pub_name") 23 */ 24 private $name; 25 26 public function __construct($name) 27 { 28 $this->name = $name; 29 } 30 31 public function getName() 32 { 33 return $this->name; 34 } 35} 36