ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
Group.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
22 
35 
47 class Group
48 {
50 
51  public function __construct(Factory $dataFactory)
52  {
53  $this->dataFactory = $dataFactory;
54  }
55 
76  public function int(): Transformation
77  {
78  return new IntegerTransformation();
79  }
80 
102  public function float(): Transformation
103  {
104  return new FloatTransformation();
105  }
106 
128  public function string(): Transformation
129  {
130  return new StringTransformation();
131  }
132 
133 
159  public function bool(): Transformation
160  {
161  return new BooleanTransformation();
162  }
163 
174  public function dateTime(): Transformation
175  {
176  return new DateTimeTransformation();
177  }
178 
185  public function listOf(Transformation $transformation): Transformation
186  {
187  return new ListTransformation($transformation);
188  }
189 
195  public function dictOf(Transformation $transformation): Transformation
196  {
197  return new DictionaryTransformation($transformation);
198  }
199 
209  public function tupleOf(array $transformation): Transformation
210  {
211  return new TupleTransformation($transformation);
212  }
213 
222  public function recordOf(array $transformations): Transformation
223  {
224  return new RecordTransformation($transformations);
225  }
226 
234  public function null(): Transformation
235  {
236  return new NullTransformation();
237  }
238 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Group.php:21
recordOf(array $transformations)
Get a kind transformation to a record.
Definition: Group.php:222
int()
Get a kind transformation to an int.
Definition: Group.php:76
Transformations in this group transform data to primitive types to establish a baseline for more comp...
Definition: Group.php:47
float()
Get a kind transformation to a float.
Definition: Group.php:102
Transform date format to DateTimeImmutable Please note:
null()
Get a kind transformation to null.
Definition: Group.php:234
string()
Get a kind transformation to a string.
Definition: Group.php:128
dateTime()
Get a kind transformation to a DateTimeImmutable.
Definition: Group.php:174
listOf(Transformation $transformation)
Get a kind transformation to a list.
Definition: Group.php:185
bool()
Get a kind transformation to a bool.
Definition: Group.php:159
A transformation is a function from one datatype to another.
tupleOf(array $transformation)
Get a kind transformation to a tuple.
Definition: Group.php:209
__construct(Factory $dataFactory)
Definition: Group.php:51
dictOf(Transformation $transformation)
Get a kind transformation to a dictionary.
Definition: Group.php:195