1 | <?php namespace JobApis\Jobs\Client; |
||
7 | trait JsonLinkedDataTrait |
||
8 | { |
||
9 | /** |
||
10 | * Serialize object as array |
||
11 | * |
||
12 | * @param string $serializeSetting |
||
13 | * |
||
14 | * @return array |
||
15 | */ |
||
16 | 8 | protected function serialize($serializeSetting) |
|
36 | |||
37 | /** |
||
38 | * Create serialized array of given object, including recursion |
||
39 | * |
||
40 | * @param object $object |
||
41 | * @param string $serializeSetting |
||
42 | * |
||
43 | * @return array |
||
44 | */ |
||
45 | 8 | private function createSerializedArrayFromObject($object, $serializeSetting) |
|
80 | |||
81 | /** |
||
82 | * Check if given property should be included in serialization |
||
83 | * |
||
84 | * @param ReflectionProperty $property |
||
85 | * @param string $serializeSetting |
||
86 | * |
||
87 | * @return boolean |
||
88 | */ |
||
89 | 8 | private function includeGivenProperty(ReflectionProperty $property, $serializeSetting) |
|
94 | |||
95 | /** |
||
96 | * Attempt to merge a value with an existing array |
||
97 | * |
||
98 | * @param array $array |
||
99 | * @param string $name |
||
100 | * @param mixed $value |
||
101 | * @param Closure $recursion |
||
102 | * |
||
103 | * @return array |
||
104 | */ |
||
105 | 8 | private function mergeWithArray(array $array, $name, $value, Closure $recursion) |
|
117 | |||
118 | /** |
||
119 | * Get core schema types |
||
120 | * |
||
121 | * @return array |
||
122 | */ |
||
123 | abstract public function getCoreSchemaTypes(); |
||
124 | |||
125 | /** |
||
126 | * Check if setting indicates if only core schema should be included |
||
127 | * |
||
128 | * @param string $setting |
||
129 | * |
||
130 | * @return boolean |
||
131 | */ |
||
132 | 8 | private function settingIsCoreSchema($setting) |
|
138 | |||
139 | /** |
||
140 | * Get linked data schema types |
||
141 | * |
||
142 | * @return array |
||
143 | */ |
||
144 | abstract public function getLinkedDataSchemaTypes(); |
||
145 | |||
146 | /** |
||
147 | * Check if setting indicates if Linked Data support should be provided |
||
148 | * |
||
149 | * @param string $setting |
||
150 | * |
||
151 | * @return boolean |
||
152 | */ |
||
153 | 8 | private function settingIsLinkedData($setting) |
|
159 | } |
||
160 |