/lib/Model/GetCharactersCharacterIdPlanetsPlanetIdOk.php

https://gitlab.com/mglinski/php-esi-lib · PHP · 308 lines · 207 code · 20 blank · 81 comment · 2 complexity · ea8a8b547918469324e863aa640dca54 MD5 · raw file

  1. <?php
  2. /**
  3. * GetCharactersCharacterIdPlanetsPlanetIdOk
  4. *
  5. * PHP version 5
  6. *
  7. * @category Class
  8. * @package ESI\Client
  9. * @author http://github.com/swagger-api/swagger-codegen
  10. * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
  11. * @link https://github.com/swagger-api/swagger-codegen
  12. */
  13. /**
  14. * EVE Swagger Interface
  15. *
  16. * An OpenAPI for EVE Online
  17. *
  18. * OpenAPI spec version: 0.3.9
  19. *
  20. * Generated by: https://github.com/swagger-api/swagger-codegen.git
  21. *
  22. * Licensed under the Apache License, Version 2.0 (the "License");
  23. * you may not use this file except in compliance with the License.
  24. * You may obtain a copy of the License at
  25. *
  26. * http://www.apache.org/licenses/LICENSE-2.0
  27. *
  28. * Unless required by applicable law or agreed to in writing, software
  29. * distributed under the License is distributed on an "AS IS" BASIS,
  30. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  31. * See the License for the specific language governing permissions and
  32. * limitations under the License.
  33. */
  34. /**
  35. * NOTE: This class is auto generated by the swagger code generator program.
  36. * https://github.com/swagger-api/swagger-codegen
  37. * Do not edit the class manually.
  38. */
  39. namespace ESI\Client\Model;
  40. use ArrayAccess;
  41. /**
  42. * GetCharactersCharacterIdPlanetsPlanetIdOk Class Doc Comment
  43. *
  44. * @category Class */
  45. // @description 200 ok object
  46. /**
  47. * @package ESI\Client
  48. * @author http://github.com/swagger-api/swagger-codegen
  49. * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
  50. * @link https://github.com/swagger-api/swagger-codegen
  51. */
  52. class GetCharactersCharacterIdPlanetsPlanetIdOk implements ArrayAccess
  53. {
  54. /**
  55. * The original name of the model.
  56. * @var string
  57. */
  58. protected static $swaggerModelName = 'get_characters_character_id_planets_planet_id_ok';
  59. /**
  60. * Array of property to type mappings. Used for (de)serialization
  61. * @var string[]
  62. */
  63. protected static $swaggerTypes = array(
  64. 'links' => '\ESI\Client\Model\GetCharactersCharacterIdPlanetsPlanetIdOkLinks[]',
  65. 'pins' => '\ESI\Client\Model\GetCharactersCharacterIdPlanetsPlanetIdOkPins[]',
  66. 'routes' => '\ESI\Client\Model\GetCharactersCharacterIdPlanetsPlanetIdOkRoutes[]'
  67. );
  68. public static function swaggerTypes()
  69. {
  70. return self::$swaggerTypes;
  71. }
  72. /**
  73. * Array of attributes where the key is the local name, and the value is the original name
  74. * @var string[]
  75. */
  76. protected static $attributeMap = array(
  77. 'links' => 'links',
  78. 'pins' => 'pins',
  79. 'routes' => 'routes'
  80. );
  81. public static function attributeMap()
  82. {
  83. return self::$attributeMap;
  84. }
  85. /**
  86. * Array of attributes to setter functions (for deserialization of responses)
  87. * @var string[]
  88. */
  89. protected static $setters = array(
  90. 'links' => 'setLinks',
  91. 'pins' => 'setPins',
  92. 'routes' => 'setRoutes'
  93. );
  94. public static function setters()
  95. {
  96. return self::$setters;
  97. }
  98. /**
  99. * Array of attributes to getter functions (for serialization of requests)
  100. * @var string[]
  101. */
  102. protected static $getters = array(
  103. 'links' => 'getLinks',
  104. 'pins' => 'getPins',
  105. 'routes' => 'getRoutes'
  106. );
  107. public static function getters()
  108. {
  109. return self::$getters;
  110. }
  111. /**
  112. * Associative array for storing property values
  113. * @var mixed[]
  114. */
  115. protected $container = array();
  116. /**
  117. * Constructor
  118. * @param mixed[] $data Associated array of property value initalizing the model
  119. */
  120. public function __construct(array $data = null)
  121. {
  122. $this->container['links'] = isset($data['links']) ? $data['links'] : null;
  123. $this->container['pins'] = isset($data['pins']) ? $data['pins'] : null;
  124. $this->container['routes'] = isset($data['routes']) ? $data['routes'] : null;
  125. }
  126. /**
  127. * show all the invalid properties with reasons.
  128. *
  129. * @return array invalid properties with reasons
  130. */
  131. public function listInvalidProperties()
  132. {
  133. $invalid_properties = array();
  134. if ($this->container['links'] === null) {
  135. $invalid_properties[] = "'links' can't be null";
  136. }
  137. if ($this->container['pins'] === null) {
  138. $invalid_properties[] = "'pins' can't be null";
  139. }
  140. if ($this->container['routes'] === null) {
  141. $invalid_properties[] = "'routes' can't be null";
  142. }
  143. return $invalid_properties;
  144. }
  145. /**
  146. * validate all the properties in the model
  147. * return true if all passed
  148. *
  149. * @return bool True if all properteis are valid
  150. */
  151. public function valid()
  152. {
  153. if ($this->container['links'] === null) {
  154. return false;
  155. }
  156. if ($this->container['pins'] === null) {
  157. return false;
  158. }
  159. if ($this->container['routes'] === null) {
  160. return false;
  161. }
  162. return true;
  163. }
  164. /**
  165. * Gets links
  166. * @return \ESI\Client\Model\GetCharactersCharacterIdPlanetsPlanetIdOkLinks[]
  167. */
  168. public function getLinks()
  169. {
  170. return $this->container['links'];
  171. }
  172. /**
  173. * Sets links
  174. * @param \ESI\Client\Model\GetCharactersCharacterIdPlanetsPlanetIdOkLinks[] $links links array
  175. * @return $this
  176. */
  177. public function setLinks($links)
  178. {
  179. $this->container['links'] = $links;
  180. return $this;
  181. }
  182. /**
  183. * Gets pins
  184. * @return \ESI\Client\Model\GetCharactersCharacterIdPlanetsPlanetIdOkPins[]
  185. */
  186. public function getPins()
  187. {
  188. return $this->container['pins'];
  189. }
  190. /**
  191. * Sets pins
  192. * @param \ESI\Client\Model\GetCharactersCharacterIdPlanetsPlanetIdOkPins[] $pins pins array
  193. * @return $this
  194. */
  195. public function setPins($pins)
  196. {
  197. $this->container['pins'] = $pins;
  198. return $this;
  199. }
  200. /**
  201. * Gets routes
  202. * @return \ESI\Client\Model\GetCharactersCharacterIdPlanetsPlanetIdOkRoutes[]
  203. */
  204. public function getRoutes()
  205. {
  206. return $this->container['routes'];
  207. }
  208. /**
  209. * Sets routes
  210. * @param \ESI\Client\Model\GetCharactersCharacterIdPlanetsPlanetIdOkRoutes[] $routes routes array
  211. * @return $this
  212. */
  213. public function setRoutes($routes)
  214. {
  215. $this->container['routes'] = $routes;
  216. return $this;
  217. }
  218. /**
  219. * Returns true if offset exists. False otherwise.
  220. * @param integer $offset Offset
  221. * @return boolean
  222. */
  223. public function offsetExists($offset)
  224. {
  225. return isset($this->container[$offset]);
  226. }
  227. /**
  228. * Gets offset.
  229. * @param integer $offset Offset
  230. * @return mixed
  231. */
  232. public function offsetGet($offset)
  233. {
  234. return isset($this->container[$offset]) ? $this->container[$offset] : null;
  235. }
  236. /**
  237. * Sets value based on offset.
  238. * @param integer $offset Offset
  239. * @param mixed $value Value to be set
  240. * @return void
  241. */
  242. public function offsetSet($offset, $value)
  243. {
  244. if (is_null($offset)) {
  245. $this->container[] = $value;
  246. } else {
  247. $this->container[$offset] = $value;
  248. }
  249. }
  250. /**
  251. * Unsets offset.
  252. * @param integer $offset Offset
  253. * @return void
  254. */
  255. public function offsetUnset($offset)
  256. {
  257. unset($this->container[$offset]);
  258. }
  259. /**
  260. * Gets the string presentation of the object
  261. * @return string
  262. */
  263. public function __toString()
  264. {
  265. if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
  266. return json_encode(\ESI\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
  267. }
  268. return json_encode(\ESI\Client\ObjectSerializer::sanitizeForSerialization($this));
  269. }
  270. }