/
a11igator
/
gigachat-php-sdk
Обзор
Документация
Войти
/
a11igator
/
gigachat-php-sdk
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/Type/Model.php
51 строка
1 KB
Eduard Gaynutdinov
init commit
03 фев 2024, 02:14
03 фев 2024, 02:14
0bf6651
Код
Авторство
О чём код?
<?php declare(strict_types=1); namespace Edvardpotter\GigaChat\Type; class Model implements ArrayConverterInterface { public const ID_GIGACHAT = 'GigaChat'; public const ID_GIGACHAT_PRO = 'GigaChat-Pro'; public const ID_GIGACHAT_PLUS = 'GigaChat-Plus'; public const ID_GIGACHAT_LATEST = 'GigaChat:latest'; private string $id; private string $object; private string $ownedBy; public function __construct( string $id, string $object, string $ownedBy ) { $this->id = $id; $this->object = $object; $this->ownedBy = $ownedBy; } public function getId(): string { return $this->id; } public function getObject(): string { return $this->object; } public function getOwnedBy(): string { return $this->ownedBy; } public static function createFromArray(array $array): self { return new Model( $array['id'], $array['object'], $array['owned_by'] ); } }