ILIAS  release_7 Revision v7.30-3-g800a261c036
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\URI. More...
 
 byTrying (array $transformations)
 Accepts Transformations and uses first successful one. More...
 

Private Attributes

 $dataFactory
 
 $language
 

Detailed Description

Definition at line 16 of file Factory.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 32 of file Factory.php.

33 {
34 $this->dataFactory = $dataFactory;
35 $this->language = $language;
36
37 $this->language->loadLanguageModule('validation');
38 }
language()
Definition: language.php:2

References language().

+ Here is the call graph for this function:

Member Function Documentation

◆ byTrying()

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

Accepts Transformations and uses first successful one.

Parameters
Transformation[]$transformations

Definition at line 184 of file Factory.php.

184 : ByTrying
185 {
186 return new ByTrying($transformations, $this->dataFactory, $this->language);
187 }

References language().

+ Here is the call graph for this function:

◆ container()

ILIAS\Refinery\Factory::container ( )

Contains constraints for container types (e.g.

arrays)

Returns
Container\Group

Definition at line 115 of file Factory.php.

116 {
117 return new Container\Group($this->dataFactory, $this->language);
118 }

References language().

+ Here is the call graph for this function:

◆ custom()

ILIAS\Refinery\Factory::custom ( )

Contains constraints and transformations for custom functions.

Returns
Custom\Group

Definition at line 105 of file Factory.php.

105 : Custom\Group
106 {
107 return new Custom\Group($this->dataFactory, $this->language);
108 }

References language().

+ Here is the call graph for this function:

◆ dateTime()

ILIAS\Refinery\Factory::dateTime ( )

Contains transformations for DateTime.

Returns
DateTime\Group

Definition at line 165 of file Factory.php.

166 {
167 return new DateTime\Group();
168 }

◆ 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.

Returns
In\Group

Definition at line 74 of file Factory.php.

74 : In\Group
75 {
76 return new In\Group();
77 }

◆ int()

ILIAS\Refinery\Factory::int ( )

Contains constraints and transformations on numbers.

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

Returns
Integer\Group

Definition at line 85 of file Factory.php.

85 : Integer\Group
86 {
87 return new Integer\Group($this->dataFactory, $this->language);
88 }

References language().

+ 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.

Returns
KindlyTo\Group

Definition at line 62 of file Factory.php.

62 : KindlyTo\Group
63 {
64 return new KindlyTo\Group($this->dataFactory);
65 }

◆ logical()

ILIAS\Refinery\Factory::logical ( )

Contains constraints for logical compositions with other constraints.

Returns
Logical\Group

Definition at line 135 of file Factory.php.

136 {
137 return new Logical\Group($this->dataFactory, $this->language);
138 }

References language().

+ Here is the call graph for this function:

◆ null()

ILIAS\Refinery\Factory::null ( )

Contains constraints for null types.

Returns
IsNull

Definition at line 145 of file Factory.php.

146 {
147 return new IsNull($this->dataFactory, $this->language);
148 }

References language().

+ Here is the call graph for this function:

◆ numeric()

ILIAS\Refinery\Factory::numeric ( )

Contains constraints for numeric data types.

Returns
Numeric\Group

Definition at line 155 of file Factory.php.

156 {
157 return new Numeric\Group($this->dataFactory, $this->language);
158 }

References language().

+ Here is the call graph for this function:

◆ password()

ILIAS\Refinery\Factory::password ( )

Contains constraints for password strings.

Returns
Password\Group

Definition at line 125 of file Factory.php.

126 {
127 return new Password\Group($this->dataFactory, $this->language);
128 }

References language().

+ Here is the call graph for this function:

◆ string()

ILIAS\Refinery\Factory::string ( )

Contains constraints for string.

Returns
String\Group

Definition at line 95 of file Factory.php.

95 : String\Group
96 {
97 return new String\Group($this->dataFactory, $this->language);
98 }

References language().

+ 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.

Returns
To\Group

Definition at line 46 of file Factory.php.

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

◆ uri()

ILIAS\Refinery\Factory::uri ( )

Contains transformations for Data\URI.

Returns
URI\Group

Definition at line 175 of file Factory.php.

175 : URI\Group
176 {
177 return new URI\Group();
178 }

Field Documentation

◆ $dataFactory

ILIAS\Refinery\Factory::$dataFactory
private

Definition at line 21 of file Factory.php.

◆ $language

ILIAS\Refinery\Factory::$language
private

Definition at line 26 of file Factory.php.


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