Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
inputoutputspec.php
1<?php
2
4
6{
7 public const TYPES = [
8 'URL' => 'url',
9 'BOOLEAN' => 'boolean',
10 'INTEGER' => 'integer',
11 'STRING' => 'string',
12 'FLOAT' => 'float',
13 'JSON' => 'json',
14 'FILE' => 'file',
15 ];
19 private $identificator;
20
24 private $type;
25
29 private $required = true;
30
34 public function getIdentificator(): string
35 {
36 return $this->identificator;
37 }
38
44 public function setIdentificator(string $identificator): InputOutputSpec
45 {
46 $this->identificator = $identificator;
47
48 return $this;
49 }
50
54 public function getType(): string
55 {
56 return $this->type;
57 }
58
64 public function setType(string $type): InputOutputSpec
65 {
66 $this->type = $type;
67
68 return $this;
69 }
70
71 public function toArray(): array
72 {
73 return [
74 $this->identificator => [
75 "type" => $this->type,
76 "required" => (bool)$this->required,
77 ]
78 ];
79 }
80}