Bristol SU Support Package
RegisteredConnector.php
Go to the documentation of this file.
1 <?php
2 
4 
8 
12 class RegisteredConnector implements Arrayable, Jsonable
13 {
14 
20  private $name;
21 
27  private $description;
28 
34  private $service;
35 
41  private $alias;
42 
48  private $connector;
49 
55  public function getName(): string
56  {
57  return $this->name;
58  }
59 
66  public function setName(string $name): void
67  {
68  $this->name = $name;
69  }
70 
76  public function getDescription(): string
77  {
78  return $this->description;
79  }
80 
87  public function setDescription(string $description): void
88  {
89  $this->description = $description;
90  }
91 
97  public function getService(): string
98  {
99  return $this->service;
100  }
101 
108  public function setService(string $service): void
109  {
110  $this->service = $service;
111  }
112 
118  public function getAlias(): string
119  {
120  return $this->alias;
121  }
122 
129  public function setAlias(string $alias): void
130  {
131  $this->alias = $alias;
132  }
133 
139  public function getConnector(): string
140  {
141  return $this->connector;
142  }
143 
150  public function setConnector(string $connector): void
151  {
152  $this->connector = $connector;
153  }
154 
160  public function toArray()
161  {
162  return [
163  'name' => $this->getName(),
164  'description' => $this->getDescription(),
165  'service' => $this->getService(),
166  'alias' => $this->getAlias(),
167  'settings' => (new VFGTransformer)->transformToArray($this->getConnector()::settingsSchema())
168  ];
169  }
170 
178  public function toJson($options = 0): string
179  {
180  return json_encode($this->toArray(), $options);
181  }
182 
188  public function __toString(): string
189  {
190  return $this->toJson();
191  }
192 
193 }