1 <?php
2 
3 declare(strict_types=1);
4 
5 namespace JMS\Serializer\Tests\Fixtures;
6 
7 use JMS\Serializer\Annotation\Accessor;
8 use JMS\Serializer\Annotation\ReadOnly;
9 use JMS\Serializer\Annotation\SerializedName;
10 use JMS\Serializer\Annotation\Type;
11 use JMS\Serializer\Annotation\XmlRoot;
12 
13 /**
14  * @XmlRoot("author")
15  * @ReadOnly
16  */
17 class AuthorReadOnlyPerClass
18 {
19     /**
20      * @ReadOnly
21      * @SerializedName("id")
22      */
23     private $id;
24 
25     /**
26      * @Type("string")
27      * @SerializedName("full_name")
28      * @Accessor("getName")
29      * @ReadOnly(false)
30      */
31     private $name;
32 
33     public function __construct($id, $name)
34     {
35         $this->id = $id;
36         $this->name = $name;
37     }
38 
39     public function getId()
40     {
41         return $this->id;
42     }
43 
44     public function getName()
45     {
46         return $this->name;
47     }
48 }
49