ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
Group.php
Go to the documentation of this file.
1 <?php
2 declare(strict_types=1);
3 
4 /* Copyright (c) 2020 Richard Klees, Extended GPL, see docs/LICENSE */
5 /* Copyright (c) 2020 Luka K. A. Stocker, Extended GPL, see docs/LICENSE */
6 
8 
20 
32 class Group
33 {
37  private $dataFactory;
38 
39  public function __construct(\ILIAS\Data\Factory $dataFactory)
40  {
41  $this->dataFactory = $dataFactory;
42  }
43 
64  public function int() : Transformation
65  {
66  return new IntegerTransformation();
67  }
68 
90  public function float() : Transformation
91  {
92  return new FloatTransformation();
93  }
94 
116  public function string() : Transformation
117  {
118  return new StringTransformation();
119  }
120 
121 
147  public function bool() : Transformation
148  {
149  return new BooleanTransformation();
150  }
151 
162  public function dateTime() : Transformation
163  {
164  return new DateTimeTransformation();
165  }
166 
173  public function listOf(Transformation $transformation) : Transformation
174  {
175  return new ListTransformation($transformation);
176  }
177 
183  public function dictOf(Transformation $transformation) : Transformation
184  {
185  return new DictionaryTransformation($transformation);
186  }
187 
197  public function tupleOf(array $transformation) : Transformation
198  {
199  return new TupleTransformation($transformation);
200  }
201 
210  public function recordOf(array $transformations) : Transformation
211  {
212  return new RecordTransformation($transformations);
213  }
214 
222  public function null() : Transformation
223  {
224  return new NullTransformation();
225  }
226 }
recordOf(array $transformations)
Get a kind transformation to a record.
Definition: Group.php:210
int()
Get a kind transformation to an int.
Definition: Group.php:64
Transformations in this group transform data to primitive types to establish a baseline for more comp...
Definition: Group.php:32
float()
Get a kind transformation to a float.
Definition: Group.php:90
Class ChatMainBarProvider .
Transform date format to DateTimeImmutable Please note:
null()
Get a kind transformation to null.
Definition: Group.php:222
string()
Get a kind transformation to a string.
Definition: Group.php:116
dateTime()
Get a kind transformation to a DateTimeImmutable.
Definition: Group.php:162
listOf(Transformation $transformation)
Get a kind transformation to a list.
Definition: Group.php:173
Builds data types.
Definition: Factory.php:19
bool()
Get a kind transformation to a bool.
Definition: Group.php:147
A transformation is a function from one datatype to another.
tupleOf(array $transformation)
Get a kind transformation to a tuple.
Definition: Group.php:197
__construct(\ILIAS\Data\Factory $dataFactory)
Definition: Group.php:39
dictOf(Transformation $transformation)
Get a kind transformation to a dictionary.
Definition: Group.php:183