Array.php
1 year ago
Broken.php
1 year ago
ClassWithCtor.php
1 year ago
ComplexClassWithCtor.php
1 year ago
DependencyInjector.php
1 year ago
DerivedClass.php
1 year ago
DerivedClass2.php
1 year ago
FactoryMethod.php
1 year ago
FactoryMethodWithError.php
1 year ago
JsonMapperCommentsDiscardedException.php
1 year ago
JsonMapperForCheckingAllowedPaths.php
1 year ago
Logger.php
1 year ago
MapsWithSetters.php
1 year ago
Php7TypedClass.php
1 year ago
Php7_1TypedClass.php
1 year ago
PrivateWithSetter.php
1 year ago
Simple.php
1 year ago
SimpleBase.php
1 year ago
SimpleBaseWithMissingDiscrimType.php
1 year ago
ValueObject.php
1 year ago
MapsWithSetters.php
56 lines
| 1 | <?php |
| 2 | |
| 3 | class MapsWithSetters |
| 4 | { |
| 5 | private $name; |
| 6 | private $age; |
| 7 | private $mappedAndFactory; |
| 8 | |
| 9 | /** |
| 10 | * @maps public |
| 11 | */ |
| 12 | public $publicProp; |
| 13 | |
| 14 | public function setName($name) |
| 15 | { |
| 16 | $this->name = $name; |
| 17 | } |
| 18 | |
| 19 | /** |
| 20 | * @maps my_age |
| 21 | */ |
| 22 | public function setAge($age) |
| 23 | { |
| 24 | $this->age = $age; |
| 25 | } |
| 26 | |
| 27 | /** |
| 28 | * @factory MapsWithSetters::factory |
| 29 | * @maps factoryValue |
| 30 | */ |
| 31 | public function setMappedAndFactory($val) |
| 32 | { |
| 33 | $this->mappedAndFactory = $val; |
| 34 | } |
| 35 | |
| 36 | public function getName() |
| 37 | { |
| 38 | return $this->name; |
| 39 | } |
| 40 | |
| 41 | public function getAge() |
| 42 | { |
| 43 | return $this->age; |
| 44 | } |
| 45 | |
| 46 | public function getMappedAndFactory() |
| 47 | { |
| 48 | return $this->mappedAndFactory; |
| 49 | } |
| 50 | |
| 51 | public static function factory($val) |
| 52 | { |
| 53 | return 'value is ' . $val; |
| 54 | } |
| 55 | } |
| 56 |