ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ILIAS\Refinery\Factory Class Reference
+ Collaboration diagram for ILIAS\Refinery\Factory:

Public Member Functions

 __construct (\ILIAS\Data\Factory $dataFactory, ilLanguage $language)
 
 to ()
 Combined validations and transformations for primitive data types that establish a baseline for further constraints and more complex transformations. More...
 
 kindlyTo ()
 Combined validations and transformations for primitive data types that establish a baseline for further constraints and more complex transformations. More...
 
 in ()
 Creates a factory object to create a transformation object, that can be used to execute other transformation objects in a desired order. More...
 
 int ()
 Contains constraints and transformations on numbers. More...
 
 string ()
 Contains constraints for string. More...
 
 custom ()
 Contains constraints and transformations for custom functions. More...
 
 container ()
 Contains constraints for container types (e.g. More...
 
 password ()
 Contains constraints for password strings. More...
 
 logical ()
 Contains constraints for logical compositions with other constraints. More...
 
 null ()
 Contains constraints for null types. More...
 
 numeric ()
 Contains constraints for numeric data types. More...
 
 dateTime ()
 Contains transformations for DateTime. More...
 
 uri ()
 Contains transformations for Data. More...
 
 byTrying (array $transformations)
 Accepts Transformations and uses first successful one. More...
 
 random ()
 
 identity ()
 
 always ($value)
 

Private Attributes

ILIAS Data Factory $dataFactory
 
ilLanguage $language
 

Detailed Description

Definition at line 28 of file Factory.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Refinery\Factory::__construct ( \ILIAS\Data\Factory  $dataFactory,
ilLanguage  $language 
)

Definition at line 33 of file Factory.php.

References ILIAS\UI\examples\Symbol\Glyph\Language\language().

34  {
35  $this->dataFactory = $dataFactory;
36  $this->language = $language;
37 
38  $this->language->loadLanguageModule('validation');
39  }
ILIAS Data Factory $dataFactory
Definition: Factory.php:30
+ Here is the call graph for this function:

Member Function Documentation

◆ always()

ILIAS\Refinery\Factory::always (   $value)

Definition at line 174 of file Factory.php.

174  : Transformation
175  {
176  return new ConstantTransformation($value);
177  }

◆ byTrying()

ILIAS\Refinery\Factory::byTrying ( array  $transformations)

Accepts Transformations and uses first successful one.

Parameters
Transformation[]$transformations

Definition at line 159 of file Factory.php.

159  : ByTrying
160  {
161  return new ByTrying($transformations, $this->dataFactory);
162  }

◆ container()

ILIAS\Refinery\Factory::container ( )

Contains constraints for container types (e.g.

arrays)

Definition at line 102 of file Factory.php.

References ILIAS\UI\Implementation\Component\Input\Group.

103  {
104  return new Container\Group($this->dataFactory);
105  }

◆ custom()

ILIAS\Refinery\Factory::custom ( )

Contains constraints and transformations for custom functions.

Definition at line 94 of file Factory.php.

References ILIAS\UI\Implementation\Component\Input\Group, and ILIAS\UI\examples\Symbol\Glyph\Language\language().

94  : Custom\Group
95  {
96  return new Custom\Group($this->dataFactory, $this->language);
97  }
+ Here is the call graph for this function:

◆ dateTime()

ILIAS\Refinery\Factory::dateTime ( )

Contains transformations for DateTime.

Definition at line 142 of file Factory.php.

References ILIAS\UI\Implementation\Component\Input\Group.

143  {
144  return new DateTime\Group();
145  }

◆ identity()

ILIAS\Refinery\Factory::identity ( )

Definition at line 169 of file Factory.php.

169  : Transformation
170  {
171  return new IdentityTransformation();
172  }

◆ in()

ILIAS\Refinery\Factory::in ( )

Creates a factory object to create a transformation object, that can be used to execute other transformation objects in a desired order.

Definition at line 69 of file Factory.php.

References ILIAS\UI\Implementation\Component\Input\Group.

69  : In\Group
70  {
71  return new In\Group();
72  }

◆ int()

ILIAS\Refinery\Factory::int ( )

Contains constraints and transformations on numbers.

Each constraint on an int will attempt to transform to int as well.

Definition at line 78 of file Factory.php.

References ILIAS\UI\Implementation\Component\Input\Group, and ILIAS\UI\examples\Symbol\Glyph\Language\language().

79  {
80  return new Integer\Group($this->dataFactory, $this->language);
81  }
+ Here is the call graph for this function:

◆ kindlyTo()

ILIAS\Refinery\Factory::kindlyTo ( )

Combined validations and transformations for primitive data types that establish a baseline for further constraints and more complex transformations.

Other then the to-group, the kindlyTo transformation attempts to implement Postels Law by being reasonably liberal when interpreting data. Look into the various transformations in the group for detailed information what works exactly.

Definition at line 59 of file Factory.php.

References ILIAS\UI\Implementation\Component\Input\Group.

Referenced by ILIAS\HTTP\Wrapper\SuperGlobalDropInReplacement\__construct(), ilObjGroupGUI\_goto(), and ilObjCourseGUI\_goto().

60  {
61  return new KindlyTo\Group($this->dataFactory);
62  }
+ Here is the caller graph for this function:

◆ logical()

ILIAS\Refinery\Factory::logical ( )

Contains constraints for logical compositions with other constraints.

Definition at line 118 of file Factory.php.

References ILIAS\UI\Implementation\Component\Input\Group, and ILIAS\UI\examples\Symbol\Glyph\Language\language().

118  : Logical\Group
119  {
120  return new Logical\Group($this->dataFactory, $this->language);
121  }
+ Here is the call graph for this function:

◆ null()

ILIAS\Refinery\Factory::null ( )

Contains constraints for null types.

Definition at line 126 of file Factory.php.

References ILIAS\UI\examples\Symbol\Glyph\Language\language().

126  : Constraint
127  {
128  return new IsNull($this->dataFactory, $this->language);
129  }
+ Here is the call graph for this function:

◆ numeric()

ILIAS\Refinery\Factory::numeric ( )

Contains constraints for numeric data types.

Definition at line 134 of file Factory.php.

References ILIAS\UI\Implementation\Component\Input\Group, and ILIAS\UI\examples\Symbol\Glyph\Language\language().

134  : Numeric\Group
135  {
136  return new Numeric\Group($this->dataFactory, $this->language);
137  }
+ Here is the call graph for this function:

◆ password()

ILIAS\Refinery\Factory::password ( )

Contains constraints for password strings.

Definition at line 110 of file Factory.php.

References ILIAS\UI\Implementation\Component\Input\Group, and ILIAS\UI\examples\Symbol\Glyph\Language\language().

111  {
112  return new Password\Group($this->dataFactory, $this->language);
113  }
+ Here is the call graph for this function:

◆ random()

ILIAS\Refinery\Factory::random ( )

Definition at line 164 of file Factory.php.

164  : RandomGroup
165  {
166  return new RandomGroup();
167  }

◆ string()

ILIAS\Refinery\Factory::string ( )

Contains constraints for string.

Definition at line 86 of file Factory.php.

References ILIAS\UI\Implementation\Component\Input\Group, and ILIAS\UI\examples\Symbol\Glyph\Language\language().

86  : String\Group
87  {
88  return new String\Group($this->dataFactory, $this->language);
89  }
+ Here is the call graph for this function:

◆ to()

ILIAS\Refinery\Factory::to ( )

Combined validations and transformations for primitive data types that establish a baseline for further constraints and more complex transformations.

Definition at line 45 of file Factory.php.

References ILIAS\UI\Implementation\Component\Input\Group.

45  : To\Group
46  {
47  return new To\Group($this->dataFactory);
48  }

◆ uri()

ILIAS\Refinery\Factory::uri ( )

Contains transformations for Data.

Definition at line 150 of file Factory.php.

References ILIAS\UI\Implementation\Component\Input\Group.

150  : URI\Group
151  {
152  return new URI\Group();
153  }

Field Documentation

◆ $dataFactory

ILIAS Data Factory ILIAS\Refinery\Factory::$dataFactory
private

Definition at line 30 of file Factory.php.

◆ $language

ilLanguage ILIAS\Refinery\Factory::$language
private

Definition at line 31 of file Factory.php.


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