ILIAS  release_7 Revision v7.30-3-g800a261c036
ILIAS\Refinery\To\Group Class Reference
+ Collaboration diagram for ILIAS\Refinery\To\Group:

Public Member Functions

 __construct (\ILIAS\Data\Factory $dataFactory)
 
 string ()
 Returns an object that allows to transform a value to a string value. More...
 
 int ()
 Returns an object that allows to transform a value to an integer value. More...
 
 float ()
 Returns an object that allows to transform a value to a float value. More...
 
 bool ()
 Returns an object that allows to transform a value to a boolean value. More...
 
 listOf (Transformation $transformation)
 Returns an object that allows to transform an value in a given array with the given transformation object. More...
 
 dictOf (Transformation $transformation)
 Returns an object that allows to transform the values of an associative array with the given transformation object. More...
 
 tupleOf (array $transformation)
 Returns an object that allows to transform the values of an array with the given array of transformations objects. More...
 
 recordOf (array $transformations)
 Returns an object that allows to transform the values of an associative array with the given associative array of transformations objects. More...
 
 toNew ($classNameOrArray)
 Returns either an transformation object to create objects of an existing class, with variations of constructor parameters OR returns an transformation object to execute a certain method with variation of parameters on the objects. More...
 
 data (string $dataType)
 
 dateTime ()
 

Private Attributes

 $dataFactory
 

Detailed Description

Definition at line 25 of file Group.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Refinery\To\Group::__construct ( \ILIAS\Data\Factory  $dataFactory)
Parameters
\ILIAS\Data\Factory$dataFactory

Definition at line 35 of file Group.php.

References ILIAS\Refinery\To\Group\$dataFactory.

36  {
37  $this->dataFactory = $dataFactory;
38  }

Member Function Documentation

◆ bool()

ILIAS\Refinery\To\Group::bool ( )

Returns an object that allows to transform a value to a boolean value.

Returns
BooleanTransformation

Definition at line 75 of file Group.php.

75  : BooleanTransformation
76  {
77  return new BooleanTransformation();
78  }

◆ data()

ILIAS\Refinery\To\Group::data ( string  $dataType)
Parameters
string$dataType- Name of the data type, this value MUST much with the methods provided by the \ILIAS\Data\Factory
Returns
Transformation

Definition at line 179 of file Group.php.

References ILIAS\Refinery\To\Group\toNew().

179  : Transformation
180  {
181  return $this->toNew(array($this->dataFactory, $dataType));
182  }
toNew($classNameOrArray)
Returns either an transformation object to create objects of an existing class, with variations of co...
Definition: Group.php:163
+ Here is the call graph for this function:

◆ dateTime()

ILIAS\Refinery\To\Group::dateTime ( )

Definition at line 185 of file Group.php.

185  : DateTimeTransformation
186  {
187  return new DateTimeTransformation($this->dataFactory);
188  }

◆ dictOf()

ILIAS\Refinery\To\Group::dictOf ( Transformation  $transformation)

Returns an object that allows to transform the values of an associative array with the given transformation object.

The keys of an associative array MUST be of type String

Using ILIAS\Refinery\Factory::to() will check if the value is identical to the value after the transformation.

Parameters
Transformation$transformation
Returns
Transformation

Definition at line 107 of file Group.php.

107  : Transformation
108  {
109  return new DictionaryTransformation($transformation);
110  }

◆ float()

ILIAS\Refinery\To\Group::float ( )

Returns an object that allows to transform a value to a float value.

Returns
FloatTransformation

Definition at line 65 of file Group.php.

65  : FloatTransformation
66  {
67  return new FloatTransformation();
68  }

◆ int()

ILIAS\Refinery\To\Group::int ( )

Returns an object that allows to transform a value to an integer value.

Returns
IntegerTransformation

Definition at line 55 of file Group.php.

55  : IntegerTransformation
56  {
57  return new IntegerTransformation();
58  }

◆ listOf()

ILIAS\Refinery\To\Group::listOf ( Transformation  $transformation)

Returns an object that allows to transform an value in a given array with the given transformation object.

The transformation will be executed on every element of the array.

Using ILIAS\Refinery\Factory::to() will check if the value is identical to the value after the transformation.

Parameters
Transformation$transformation
Returns
Transformation

Definition at line 91 of file Group.php.

91  : Transformation
92  {
93  return new ListTransformation($transformation);
94  }

◆ recordOf()

ILIAS\Refinery\To\Group::recordOf ( array  $transformations)

Returns an object that allows to transform the values of an associative array with the given associative array of transformations objects.

The length of the array of transformations MUST be identical to the array of values to transform. The keys of the transformation array will be the same as the key from the value array e.g. Transformation with the key "hello" will transform value with the key "hello" of the value array.

Using ILIAS\Refinery\Factory::to() will check if the value is identical to the value after the transformation.

Parameters
array$transformations
Returns
Transformation

Definition at line 149 of file Group.php.

149  : Transformation
150  {
151  return new RecordTransformation($transformations);
152  }

◆ string()

ILIAS\UI\Implementation\Component\Item\Group::string ( )

Returns an object that allows to transform a value to a string value.

Returns
StringTransformation

Definition at line 45 of file Group.php.

45  : StringTransformation
46  {
47  return new StringTransformation();
48  }

◆ toNew()

ILIAS\Refinery\To\Group::toNew (   $classNameOrArray)

Returns either an transformation object to create objects of an existing class, with variations of constructor parameters OR returns an transformation object to execute a certain method with variation of parameters on the objects.

Parameters
$classNameOrArray
Returns
Transformation

Definition at line 163 of file Group.php.

Referenced by ILIAS\Refinery\To\Group\data().

163  : Transformation
164  {
165  if (is_array($classNameOrArray)) {
166  if (2 !== count($classNameOrArray)) {
167  throw new \InvalidArgumentException('The array MUST contain exactly two elements');
168  }
169  return new NewMethodTransformation($classNameOrArray[0], $classNameOrArray[1]);
170  }
171  return new NewObjectTransformation($classNameOrArray);
172  }
+ Here is the caller graph for this function:

◆ tupleOf()

ILIAS\Refinery\To\Group::tupleOf ( array  $transformation)

Returns an object that allows to transform the values of an array with the given array of transformations objects.

The length of the array of transformations MUST be identical to the array of values to transform. The keys of the transformation array will be the same as the key from the value array e.g. Transformation on position 2 will transform value on position 2 of the value array.

Using ILIAS\Refinery\Factory::to() will check if the value is identical to the value after the transformation.

Parameters
array$transformation
Returns
Transformation

Definition at line 127 of file Group.php.

127  : Transformation
128  {
129  return new TupleTransformation($transformation);
130  }

Field Documentation

◆ $dataFactory

ILIAS\Refinery\To\Group::$dataFactory
private

Definition at line 30 of file Group.php.

Referenced by ILIAS\Refinery\To\Group\__construct().


The documentation for this class was generated from the following file: