addType('appid', 'string'); $this->addType('name', 'string'); $this->addType('description', 'string'); $this->addType('hidden', 'integer'); $this->addType('arguments', 'json'); $this->addType('options', 'json'); $this->addType('usages', 'json'); $this->addType('executeHandler', 'string'); if (isset($params['id'])) { $this->setId($params['id']); } if (isset($params['appid'])) { $this->setAppid($params['appid']); } if (isset($params['name'])) { $this->setName($params['name']); } if (isset($params['description'])) { $this->setDescription($params['description']); } else { $this->setDescription(''); } if (isset($params['hidden'])) { $this->setHidden($params['hidden']); } if (isset($params['arguments'])) { $this->setArguments($params['arguments']); } if (isset($params['options'])) { $this->setOptions($params['options']); } if (isset($params['usages'])) { $this->setUsages($params['usages']); } if (isset($params['execute_handler'])) { $this->setExecuteHandler($params['execute_handler']); } } public function jsonSerialize(): array { return [ 'id' => $this->getId(), 'appid' => $this->getAppid(), 'name' => $this->getName(), 'description' => $this->getDescription(), 'hidden' => $this->getHidden(), 'arguments' => $this->getArguments(), 'options' => $this->getOptions(), 'usages' => $this->getUsages(), 'execute_handler' => $this->getExecuteHandler(), ]; } }