PageRenderTime 48ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/lib/Model/GetKillmailsKillmailIdKillmailHashOkVictim.php

https://gitlab.com/mglinski/php-esi-lib
PHP | 432 lines | 195 code | 53 blank | 184 comment | 6 complexity | 1fa60929d17dd1d0f28c4ae717752ad5 MD5 | raw file
  1. <?php
  2. /**
  3. * GetKillmailsKillmailIdKillmailHashOkVictim
  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. * GetKillmailsKillmailIdKillmailHashOkVictim Class Doc Comment
  43. *
  44. * @category Class */
  45. // @description victim 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 GetKillmailsKillmailIdKillmailHashOkVictim implements ArrayAccess
  53. {
  54. /**
  55. * The original name of the model.
  56. * @var string
  57. */
  58. protected static $swaggerModelName = 'get_killmails_killmail_id_killmail_hash_ok_victim';
  59. /**
  60. * Array of property to type mappings. Used for (de)serialization
  61. * @var string[]
  62. */
  63. protected static $swaggerTypes = array(
  64. 'alliance_id' => 'int',
  65. 'character_id' => 'int',
  66. 'corporation_id' => 'int',
  67. 'damage_taken' => 'int',
  68. 'faction_id' => 'int',
  69. 'items' => '\ESI\Client\Model\GetKillmailsKillmailIdKillmailHashOkVictimItems1[]',
  70. 'position' => '\ESI\Client\Model\GetKillmailsKillmailIdKillmailHashOkVictimPosition',
  71. 'ship_type_id' => 'int'
  72. );
  73. public static function swaggerTypes()
  74. {
  75. return self::$swaggerTypes;
  76. }
  77. /**
  78. * Array of attributes where the key is the local name, and the value is the original name
  79. * @var string[]
  80. */
  81. protected static $attributeMap = array(
  82. 'alliance_id' => 'alliance_id',
  83. 'character_id' => 'character_id',
  84. 'corporation_id' => 'corporation_id',
  85. 'damage_taken' => 'damage_taken',
  86. 'faction_id' => 'faction_id',
  87. 'items' => 'items',
  88. 'position' => 'position',
  89. 'ship_type_id' => 'ship_type_id'
  90. );
  91. public static function attributeMap()
  92. {
  93. return self::$attributeMap;
  94. }
  95. /**
  96. * Array of attributes to setter functions (for deserialization of responses)
  97. * @var string[]
  98. */
  99. protected static $setters = array(
  100. 'alliance_id' => 'setAllianceId',
  101. 'character_id' => 'setCharacterId',
  102. 'corporation_id' => 'setCorporationId',
  103. 'damage_taken' => 'setDamageTaken',
  104. 'faction_id' => 'setFactionId',
  105. 'items' => 'setItems',
  106. 'position' => 'setPosition',
  107. 'ship_type_id' => 'setShipTypeId'
  108. );
  109. public static function setters()
  110. {
  111. return self::$setters;
  112. }
  113. /**
  114. * Array of attributes to getter functions (for serialization of requests)
  115. * @var string[]
  116. */
  117. protected static $getters = array(
  118. 'alliance_id' => 'getAllianceId',
  119. 'character_id' => 'getCharacterId',
  120. 'corporation_id' => 'getCorporationId',
  121. 'damage_taken' => 'getDamageTaken',
  122. 'faction_id' => 'getFactionId',
  123. 'items' => 'getItems',
  124. 'position' => 'getPosition',
  125. 'ship_type_id' => 'getShipTypeId'
  126. );
  127. public static function getters()
  128. {
  129. return self::$getters;
  130. }
  131. /**
  132. * Associative array for storing property values
  133. * @var mixed[]
  134. */
  135. protected $container = array();
  136. /**
  137. * Constructor
  138. * @param mixed[] $data Associated array of property value initalizing the model
  139. */
  140. public function __construct(array $data = null)
  141. {
  142. $this->container['alliance_id'] = isset($data['alliance_id']) ? $data['alliance_id'] : null;
  143. $this->container['character_id'] = isset($data['character_id']) ? $data['character_id'] : null;
  144. $this->container['corporation_id'] = isset($data['corporation_id']) ? $data['corporation_id'] : null;
  145. $this->container['damage_taken'] = isset($data['damage_taken']) ? $data['damage_taken'] : null;
  146. $this->container['faction_id'] = isset($data['faction_id']) ? $data['faction_id'] : null;
  147. $this->container['items'] = isset($data['items']) ? $data['items'] : null;
  148. $this->container['position'] = isset($data['position']) ? $data['position'] : null;
  149. $this->container['ship_type_id'] = isset($data['ship_type_id']) ? $data['ship_type_id'] : null;
  150. }
  151. /**
  152. * show all the invalid properties with reasons.
  153. *
  154. * @return array invalid properties with reasons
  155. */
  156. public function listInvalidProperties()
  157. {
  158. $invalid_properties = array();
  159. if ($this->container['damage_taken'] === null) {
  160. $invalid_properties[] = "'damage_taken' can't be null";
  161. }
  162. if ($this->container['ship_type_id'] === null) {
  163. $invalid_properties[] = "'ship_type_id' can't be null";
  164. }
  165. return $invalid_properties;
  166. }
  167. /**
  168. * validate all the properties in the model
  169. * return true if all passed
  170. *
  171. * @return bool True if all properteis are valid
  172. */
  173. public function valid()
  174. {
  175. if ($this->container['damage_taken'] === null) {
  176. return false;
  177. }
  178. if ($this->container['ship_type_id'] === null) {
  179. return false;
  180. }
  181. return true;
  182. }
  183. /**
  184. * Gets alliance_id
  185. * @return int
  186. */
  187. public function getAllianceId()
  188. {
  189. return $this->container['alliance_id'];
  190. }
  191. /**
  192. * Sets alliance_id
  193. * @param int $alliance_id alliance_id integer
  194. * @return $this
  195. */
  196. public function setAllianceId($alliance_id)
  197. {
  198. $this->container['alliance_id'] = $alliance_id;
  199. return $this;
  200. }
  201. /**
  202. * Gets character_id
  203. * @return int
  204. */
  205. public function getCharacterId()
  206. {
  207. return $this->container['character_id'];
  208. }
  209. /**
  210. * Sets character_id
  211. * @param int $character_id character_id integer
  212. * @return $this
  213. */
  214. public function setCharacterId($character_id)
  215. {
  216. $this->container['character_id'] = $character_id;
  217. return $this;
  218. }
  219. /**
  220. * Gets corporation_id
  221. * @return int
  222. */
  223. public function getCorporationId()
  224. {
  225. return $this->container['corporation_id'];
  226. }
  227. /**
  228. * Sets corporation_id
  229. * @param int $corporation_id corporation_id integer
  230. * @return $this
  231. */
  232. public function setCorporationId($corporation_id)
  233. {
  234. $this->container['corporation_id'] = $corporation_id;
  235. return $this;
  236. }
  237. /**
  238. * Gets damage_taken
  239. * @return int
  240. */
  241. public function getDamageTaken()
  242. {
  243. return $this->container['damage_taken'];
  244. }
  245. /**
  246. * Sets damage_taken
  247. * @param int $damage_taken How much total damage was taken by the victim
  248. * @return $this
  249. */
  250. public function setDamageTaken($damage_taken)
  251. {
  252. $this->container['damage_taken'] = $damage_taken;
  253. return $this;
  254. }
  255. /**
  256. * Gets faction_id
  257. * @return int
  258. */
  259. public function getFactionId()
  260. {
  261. return $this->container['faction_id'];
  262. }
  263. /**
  264. * Sets faction_id
  265. * @param int $faction_id faction_id integer
  266. * @return $this
  267. */
  268. public function setFactionId($faction_id)
  269. {
  270. $this->container['faction_id'] = $faction_id;
  271. return $this;
  272. }
  273. /**
  274. * Gets items
  275. * @return \ESI\Client\Model\GetKillmailsKillmailIdKillmailHashOkVictimItems1[]
  276. */
  277. public function getItems()
  278. {
  279. return $this->container['items'];
  280. }
  281. /**
  282. * Sets items
  283. * @param \ESI\Client\Model\GetKillmailsKillmailIdKillmailHashOkVictimItems1[] $items items array
  284. * @return $this
  285. */
  286. public function setItems($items)
  287. {
  288. $this->container['items'] = $items;
  289. return $this;
  290. }
  291. /**
  292. * Gets position
  293. * @return \ESI\Client\Model\GetKillmailsKillmailIdKillmailHashOkVictimPosition
  294. */
  295. public function getPosition()
  296. {
  297. return $this->container['position'];
  298. }
  299. /**
  300. * Sets position
  301. * @param \ESI\Client\Model\GetKillmailsKillmailIdKillmailHashOkVictimPosition $position
  302. * @return $this
  303. */
  304. public function setPosition($position)
  305. {
  306. $this->container['position'] = $position;
  307. return $this;
  308. }
  309. /**
  310. * Gets ship_type_id
  311. * @return int
  312. */
  313. public function getShipTypeId()
  314. {
  315. return $this->container['ship_type_id'];
  316. }
  317. /**
  318. * Sets ship_type_id
  319. * @param int $ship_type_id The ship that the victim was piloting and was destroyed
  320. * @return $this
  321. */
  322. public function setShipTypeId($ship_type_id)
  323. {
  324. $this->container['ship_type_id'] = $ship_type_id;
  325. return $this;
  326. }
  327. /**
  328. * Returns true if offset exists. False otherwise.
  329. * @param integer $offset Offset
  330. * @return boolean
  331. */
  332. public function offsetExists($offset)
  333. {
  334. return isset($this->container[$offset]);
  335. }
  336. /**
  337. * Gets offset.
  338. * @param integer $offset Offset
  339. * @return mixed
  340. */
  341. public function offsetGet($offset)
  342. {
  343. return isset($this->container[$offset]) ? $this->container[$offset] : null;
  344. }
  345. /**
  346. * Sets value based on offset.
  347. * @param integer $offset Offset
  348. * @param mixed $value Value to be set
  349. * @return void
  350. */
  351. public function offsetSet($offset, $value)
  352. {
  353. if (is_null($offset)) {
  354. $this->container[] = $value;
  355. } else {
  356. $this->container[$offset] = $value;
  357. }
  358. }
  359. /**
  360. * Unsets offset.
  361. * @param integer $offset Offset
  362. * @return void
  363. */
  364. public function offsetUnset($offset)
  365. {
  366. unset($this->container[$offset]);
  367. }
  368. /**
  369. * Gets the string presentation of the object
  370. * @return string
  371. */
  372. public function __toString()
  373. {
  374. if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
  375. return json_encode(\ESI\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
  376. }
  377. return json_encode(\ESI\Client\ObjectSerializer::sanitizeForSerialization($this));
  378. }
  379. }