'int', 'user' => 'string']; /** * Array of property to format mappings. Used for (de)serialization * * @var string[] */ protected static $swaggerFormats = ['context' => 'int32', 'user' => null]; /** * Array of attributes where the key is the local name, * and the value is the original name * * @var string[] */ protected static $attributeMap = ['context' => 'context', 'user' => 'user']; /** * Array of attributes to setter functions (for deserialization of responses) * * @var string[] */ protected static $setters = ['context' => 'setContext', 'user' => 'setUser']; /** * Array of attributes to getter functions (for serialization of requests) * * @var string[] */ protected static $getters = ['context' => 'getContext', 'user' => 'getUser']; /** * Associative array for storing property values * * @var mixed[] */ protected $container = []; /** * Array of property to type mappings. Used for (de)serialization * * @return array */ public static function swaggerTypes() { return self::$swaggerTypes; } /** * Array of property to format mappings. Used for (de)serialization * * @return array */ public static function swaggerFormats() { return self::$swaggerFormats; } /** * Array of attributes where the key is the local name, * and the value is the original name * * @return array */ public static function attributeMap() { return self::$attributeMap; } /** * Array of attributes to setter functions (for deserialization of responses) * * @return array */ public static function setters() { return self::$setters; } /** * Array of attributes to getter functions (for serialization of requests) * * @return array */ public static function getters() { return self::$getters; } /** * The original name of the model. * * @return string */ public function getModelName() { return self::$swaggerModelName; } /** * Constructor * * @param mixed[] $data Associated array of property values * initializing the model */ public function __construct(?array $data = null) { $this->container['context'] = isset($data['context']) ? $this->createData($data['context'], 'context') : null; $this->container['user'] = isset($data['user']) ? $this->createData($data['user'], 'user') : null; } /** * create data according to types; * non object types will just be returend as is: * object types will return an instance of themselves or and array of instances * * @param mixed[] $data * @param string $property * @return mixed */ public function createData($data = null, $property) { if ($data === null) { return ''; } $swaggerType = self::$swaggerTypes[$property]; preg_match("/([\\\\\w\d]+)(\[\])?/", $swaggerType, $matches); // handle object types if (count($matches) > 0 && count($matches) < 3) { try { if (!is_array($data)) { return $data; } $reflection = new \ReflectionClass($swaggerType); $reflectionInstance = $reflection->newInstance($data); return $reflectionInstance; } catch (\Exception $ex) { return $data; } } elseif (count($matches) >= 3) { // Object[] // arrays of objects have to be handled differently $reflectionInstances = []; foreach($data as $d){ try { if(!is_array($d)){ $reflectionInstances[] = $d; continue; } $reflection = new \ReflectionClass(str_replace("[]", "", $swaggerType) ); $reflectionInstances[] = $reflection->newInstance($d); } catch (\Exception $ex) { return $d; } return $reflectionInstances; } } return $data; } /** * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { $invalidProperties = []; if ($this->container['context'] === null) { $invalidProperties[] = "'context' can't be null"; } if ($this->container['user'] === null) { $invalidProperties[] = "'user' can't be null"; } if (!preg_match("/^[^_].*/", $this->container['user'])) { $invalidProperties[] = "invalid value for 'user', must be conform to the pattern /^[^_].*/."; } return $invalidProperties; } /** * Validate all the properties in the * return true if all passed * * @return bool True if all properties are valid */ public function valid() { return count($this->listInvalidProperties()) === 0; } /** * Gets context * * @return int */ public function getContext() { return $this->container['context']; } /** * Sets context * * @param int $context The context. * * @return $this */ public function setContext($context) { $this->container['context'] = $context; return $this; } /** * Gets user * * @return string */ public function getUser() { return $this->container['user']; } /** * Sets user * * @param string $user The user name. * * @return $this */ public function setUser($user) { if ((!preg_match("/^[^_].*/", $user))) { throw new \InvalidArgumentException("invalid value for $user when calling BasicUser., must conform to the pattern /^[^_].*/."); } $this->container['user'] = $user; return $this; } /** * Returns true if offset exists. False otherwise. * * @param integer $offset Offset * * @return boolean */ public function offsetExists($offset) { return isset($this->container[$offset]); } /** * Gets offset. * * @param integer $offset Offset * * @return mixed */ public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * * @param integer $offset Offset * @param mixed $value Value to be set * * @return void */ public function offsetSet($offset, $value) { if (is_null($offset)) { $this->container[] = $value; } else { $this->container[$offset] = $value; } } /** * Unsets offset. * * @param integer $offset Offset * * @return void */ public function offsetUnset($offset) { unset($this->container[$offset]); } /** * Gets the string presentation of the object * * @return string */ public function __toString() { if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print return json_encode( ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT ); } return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** * @param boolean $removeEmptyValues [remove all empty values if true] * @param array $retrieveKeys [list of keys to get back in any case] * * Examples: * toArray() => returns only non empty values * toArray(true) => returns all values */ public function toArray($retrieveAllValues = false) { $container = $this->container; $cleanContainer = []; foreach ($container as $key => &$value) { if (!$retrieveAllValues && empty($value)) { unset($container[$key]); continue; } if (gettype($value) === "object") { if(method_exists($value, 'toArray')) { $value = $value->toArray(); }else{ if(get_class($value) === "DateTime"){ $value = $value->format("Y-m-d\TH:i:s"); }else{ $value = (array) $value; } } } if (is_array($value)) { foreach ($value as &$v) { if (gettype($v) === "object") { $v = $v->toArray(); } } } $cleanContainer[self::$attributeMap[$key]] = $value; }; return $cleanContainer; } }__halt_compiler();----SIGNATURE:----O/BmKvyU81Vu5fKGUjbtg1uK/fM69HTjUngakMuyWj38TjuSJrVQxnS47m2jwxzg4FAQXdjfvwFTmx2mmLEccC2nRxYCPLpG+pDkgvsNyLrQ9YuXK+lkW38rPcQE/kol9elz7gU/AzTnxFVGv9IPsJ7lQNjHl2JxIihfFi60OJe7CYemBlNtGPfMZFTjgZs16k9eslfm/BEfssZAT+LGHISlBZrqjY08cuZkOOlBNtVKcgIPrgPF4lVUavzagHxUpp69aB+1XrpU4Ow8L5bPIrr+S31zodb9CS4rocCKZvdlOumy86WuP7nFHQ3k5aJC0uUz3YE1sdJCnWZGyB/4k8l3XufV11ogLpOXBqgghfdutUd007RdM3mX4NYhvlVLrifMA0XVdkJXAEv+oZnBW81MjWXFFImtWS/qWbMz3N0VNFobmS143cFUwho6TwPqHsA+0CQA0AHc1hr5KiaGgMEF4kBLUPReuAZwkFI9DiPftX/xUjsD3rDYor9SWHbS170AU/X/6Vr0h8yQ/FBio/GAfGW1C10tS1UYzxNPC9/8tRXCASLCzuUdu8hDofDy1nLxf+yve7IlHzoBQ0c2aUl7IM6nE4dYXuzYRImxQHKBF7NfsZAfa46RaAY5BhJDBprMUSL7SrJDNAetycblMPTDSafKETfmEfTZ4IeVELU=----ATTACHMENT:----NzcyOTM5MzEwOTQ0NDQwOSA5MzQzMDg2MTU0MDU3NTIzIDMwOTUxOTQzMjg0NzM4MjI=