addType('name', Types::STRING); $this->addType('url', Types::STRING); $this->addType('url_hash', Types::STRING); $this->addType('description', Types::STRING); $this->addType('secret', Types::STRING); $this->addType('error_count', Types::BIGINT); $this->addType('last_error_date', Types::DATETIME); $this->addType('last_error_message', Types::STRING); $this->addType('state', Types::SMALLINT); $this->addType('features', Types::INTEGER); } /** * @return array{ * id: int, * name: string, * url: string, * url_hash: string, * description: ?string, * secret: string, * error_count: int, * last_error_date: int, * last_error_message: string, * state: int, * features: int, * } */ #[\Override] public function jsonSerialize(): array { return [ 'id' => $this->getId(), 'name' => $this->getName(), 'url' => $this->getUrl(), 'url_hash' => $this->getUrlHash(), 'description' => $this->getDescription(), 'secret' => $this->getSecret(), 'error_count' => $this->getErrorCount(), 'last_error_date' => $this->getLastErrorDate() ? $this->getLastErrorDate()->getTimestamp() : 0, 'last_error_message' => $this->getLastErrorMessage(), 'state' => $this->getState(), 'features' => $this->getFeatures(), ]; } }