@@ 15-89 (lines=75) @@ | ||
12 | * |
|
13 | * @package Nnx\JmsSerializerModule\Options |
|
14 | */ |
|
15 | class MetadataFactoryPluginOptions extends AbstractOptions |
|
16 | { |
|
17 | /** |
|
18 | * Имя плагина |
|
19 | * |
|
20 | * @var string |
|
21 | */ |
|
22 | protected $name; |
|
23 | ||
24 | /** |
|
25 | * Настройки плагина |
|
26 | * |
|
27 | * @var array |
|
28 | */ |
|
29 | protected $options = []; |
|
30 | ||
31 | /** |
|
32 | * Настройки для фабрики метаданных |
|
33 | * |
|
34 | * @var SerializerOptions |
|
35 | */ |
|
36 | protected $metadataFactoryOptions; |
|
37 | ||
38 | /** |
|
39 | * Возвращает имя плагина |
|
40 | * |
|
41 | * @return string |
|
42 | */ |
|
43 | public function getName() |
|
44 | { |
|
45 | return $this->name; |
|
46 | } |
|
47 | ||
48 | /** |
|
49 | * Устанавливает имя плагина |
|
50 | * |
|
51 | * @param string $name |
|
52 | * |
|
53 | * @return $this |
|
54 | */ |
|
55 | public function setName($name) |
|
56 | { |
|
57 | $this->name = $name; |
|
58 | ||
59 | return $this; |
|
60 | } |
|
61 | ||
62 | /** |
|
63 | * Возвращает настройки плагина |
|
64 | * |
|
65 | * @return MetadataFactoryOptions |
|
66 | */ |
|
67 | public function getOptions() |
|
68 | { |
|
69 | if (null === $this->metadataFactoryOptions) { |
|
70 | $this->metadataFactoryOptions = new MetadataFactoryOptions($this->options); |
|
71 | } |
|
72 | ||
73 | return $this->metadataFactoryOptions; |
|
74 | } |
|
75 | ||
76 | /** |
|
77 | * Устанавливает настройки плагина |
|
78 | * |
|
79 | * @param array $options |
|
80 | * |
|
81 | * @return $this |
|
82 | */ |
|
83 | public function setOptions(array $options) |
|
84 | { |
|
85 | $this->options = $options; |
|
86 | ||
87 | return $this; |
|
88 | } |
|
89 | } |
|
90 |
@@ 15-89 (lines=75) @@ | ||
12 | * |
|
13 | * @package Nnx\JmsSerializerModule\Options |
|
14 | */ |
|
15 | class SerializerPluginOptions extends AbstractOptions |
|
16 | { |
|
17 | /** |
|
18 | * Имя плагина |
|
19 | * |
|
20 | * @var string |
|
21 | */ |
|
22 | protected $name; |
|
23 | ||
24 | /** |
|
25 | * Настройки плагина |
|
26 | * |
|
27 | * @var array |
|
28 | */ |
|
29 | protected $options = []; |
|
30 | ||
31 | /** |
|
32 | * Настройки для сериалайзера |
|
33 | * |
|
34 | * @var SerializerOptions |
|
35 | */ |
|
36 | protected $serializerOptions; |
|
37 | ||
38 | /** |
|
39 | * Возвращает имя плагина |
|
40 | * |
|
41 | * @return string |
|
42 | */ |
|
43 | public function getName() |
|
44 | { |
|
45 | return $this->name; |
|
46 | } |
|
47 | ||
48 | /** |
|
49 | * Устанавливает имя плагина |
|
50 | * |
|
51 | * @param string $name |
|
52 | * |
|
53 | * @return $this |
|
54 | */ |
|
55 | public function setName($name) |
|
56 | { |
|
57 | $this->name = $name; |
|
58 | ||
59 | return $this; |
|
60 | } |
|
61 | ||
62 | /** |
|
63 | * Возвращает настройки плагина |
|
64 | * |
|
65 | * @return SerializerOptions |
|
66 | */ |
|
67 | public function getOptions() |
|
68 | { |
|
69 | if (null === $this->serializerOptions) { |
|
70 | $this->serializerOptions = new SerializerOptions($this->options); |
|
71 | } |
|
72 | ||
73 | return $this->serializerOptions; |
|
74 | } |
|
75 | ||
76 | /** |
|
77 | * Устанавливает настройки плагина |
|
78 | * |
|
79 | * @param array $options |
|
80 | * |
|
81 | * @return $this |
|
82 | */ |
|
83 | public function setOptions(array $options) |
|
84 | { |
|
85 | $this->options = $options; |
|
86 | ||
87 | return $this; |
|
88 | } |
|
89 | } |
|
90 |