ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\Refinery\Factory Class Reference
+ Collaboration diagram for ILIAS\Refinery\Factory:

Public Member Functions

 __construct (\ILIAS\Data\Factory $dataFactory, \ILIAS\Language\Language $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...
 
 encode ()
 
 byTrying (array $transformations)
 Accepts Transformations and uses first successful one. More...
 
 random ()
 
 identity ()
 
 always ($value)
 
 executable ()
 

Protected Member Functions

 loadLanguageModules ()
 

Private Attributes

ILIAS Data Factory $dataFactory
 
ILIAS Language Language $language
 

Detailed Description

Definition at line 25 of file Factory.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 30 of file Factory.php.

31 {
32 $this->dataFactory = $dataFactory;
33 $this->language = $language;
34 }

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

+ Here is the call graph for this function:

Member Function Documentation

◆ always()

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

Definition at line 184 of file Factory.php.

184 : Transformation
185 {
186 return new ConstantTransformation($value);
187 }

◆ byTrying()

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

Accepts Transformations and uses first successful one.

Parameters
Transformation[]$transformations

Definition at line 168 of file Factory.php.

168 : ByTrying
169 {
170 $this->loadLanguageModules();
171 return new ByTrying($transformations, $this->dataFactory, $this->language);
172 }

References ILIAS\UI\examples\Symbol\Glyph\Language\language(), and ILIAS\Refinery\Factory\loadLanguageModules().

+ Here is the call graph for this function:

◆ container()

ILIAS\Refinery\Factory::container ( )

Contains constraints for container types (e.g.

arrays)

Definition at line 101 of file Factory.php.

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

References ILIAS\ILIASObject\Creation\Group, and ILIAS\Refinery\Factory\loadLanguageModules().

+ Here is the call graph for this function:

◆ custom()

ILIAS\Refinery\Factory::custom ( )

Contains constraints and transformations for custom functions.

Definition at line 92 of file Factory.php.

93 {
94 $this->language->loadLanguageModule('validation');
95 return new Custom\Group($this->dataFactory, $this->language);
96 }

References ILIAS\ILIASObject\Creation\Group, and ILIAS\UI\examples\Symbol\Glyph\Language\language().

+ Here is the call graph for this function:

◆ dateTime()

ILIAS\Refinery\Factory::dateTime ( )

Contains transformations for DateTime.

Definition at line 146 of file Factory.php.

147 {
148 return new DateTime\Group();
149 }

References ILIAS\ILIASObject\Creation\Group.

◆ encode()

ILIAS\Refinery\Factory::encode ( )

Definition at line 159 of file Factory.php.

160 {
161 return new Encode\Group();
162 }

References ILIAS\ILIASObject\Creation\Group.

◆ executable()

ILIAS\Refinery\Factory::executable ( )

Definition at line 189 of file Factory.php.

189 : Transformation
190 {
191 $this->loadLanguageModules();
192 return new IsExecutableTransformation($this->language);
193 }

References ILIAS\UI\examples\Symbol\Glyph\Language\language(), and ILIAS\Refinery\Factory\loadLanguageModules().

+ Here is the call graph for this function:

◆ identity()

ILIAS\Refinery\Factory::identity ( )

Definition at line 179 of file Factory.php.

179 : Transformation
180 {
181 return new IdentityTransformation();
182 }

◆ 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 65 of file Factory.php.

65 : In\Group
66 {
67 return new In\Group();
68 }

References ILIAS\ILIASObject\Creation\Group.

Referenced by ILIAS\Refinery\Factory\int().

+ Here is the caller graph for this function:

◆ 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 74 of file Factory.php.

75 {
76 $this->loadLanguageModules();
77 return new Integer\Group($this->dataFactory, $this->language, $this->in());
78 }

References ILIAS\ILIASObject\Creation\Group, ILIAS\Refinery\Factory\in(), ILIAS\UI\examples\Symbol\Glyph\Language\language(), and ILIAS\Refinery\Factory\loadLanguageModules().

+ 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 55 of file Factory.php.

56 {
57 return new KindlyTo\Group($this->dataFactory);
58 }

References ILIAS\ILIASObject\Creation\Group.

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

+ Here is the caller graph for this function:

◆ loadLanguageModules()

ILIAS\Refinery\Factory::loadLanguageModules ( )
protected

◆ logical()

ILIAS\Refinery\Factory::logical ( )

Contains constraints for logical compositions with other constraints.

Definition at line 119 of file Factory.php.

120 {
121 $this->loadLanguageModules();
122 return new Logical\Group($this->dataFactory, $this->language);
123 }

References ILIAS\ILIASObject\Creation\Group, ILIAS\UI\examples\Symbol\Glyph\Language\language(), and ILIAS\Refinery\Factory\loadLanguageModules().

+ Here is the call graph for this function:

◆ null()

ILIAS\Refinery\Factory::null ( )

Contains constraints for null types.

Definition at line 128 of file Factory.php.

128 : Constraint
129 {
130 $this->loadLanguageModules();
131 return new IsNull($this->dataFactory, $this->language);
132 }

References ILIAS\UI\examples\Symbol\Glyph\Language\language(), and ILIAS\Refinery\Factory\loadLanguageModules().

+ Here is the call graph for this function:

◆ numeric()

ILIAS\Refinery\Factory::numeric ( )

Contains constraints for numeric data types.

Definition at line 137 of file Factory.php.

138 {
139 $this->loadLanguageModules();
140 return new Numeric\Group($this->dataFactory, $this->language);
141 }

References ILIAS\ILIASObject\Creation\Group, ILIAS\UI\examples\Symbol\Glyph\Language\language(), and ILIAS\Refinery\Factory\loadLanguageModules().

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

111 {
112 $this->loadLanguageModules();
113 return new Password\Group($this->dataFactory, $this->language);
114 }

References ILIAS\ILIASObject\Creation\Group, ILIAS\UI\examples\Symbol\Glyph\Language\language(), and ILIAS\Refinery\Factory\loadLanguageModules().

+ Here is the call graph for this function:

◆ random()

ILIAS\Refinery\Factory::random ( )

Definition at line 174 of file Factory.php.

174 : RandomGroup
175 {
176 return new RandomGroup();
177 }

◆ string()

ILIAS\Refinery\Factory::string ( )

Contains constraints for string.

Definition at line 83 of file Factory.php.

84 {
85 $this->loadLanguageModules();
86 return new String\Group($this->dataFactory, $this->language);
87 }

References ILIAS\ILIASObject\Creation\Group, ILIAS\UI\examples\Symbol\Glyph\Language\language(), and ILIAS\Refinery\Factory\loadLanguageModules().

+ 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 40 of file Factory.php.

40 : To\Group
41 {
42 $this->loadLanguageModules();
43 return new To\Group($this->dataFactory, $this->language);
44 }

References ILIAS\ILIASObject\Creation\Group, ILIAS\UI\examples\Symbol\Glyph\Language\language(), and ILIAS\Refinery\Factory\loadLanguageModules().

+ Here is the call graph for this function:

◆ uri()

ILIAS\Refinery\Factory::uri ( )

Contains transformations for Data\URI.

Definition at line 154 of file Factory.php.

154 : URI\Group
155 {
156 return new URI\Group();
157 }

References ILIAS\ILIASObject\Creation\Group.

Field Documentation

◆ $dataFactory

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

Definition at line 27 of file Factory.php.

◆ $language

ILIAS Language Language ILIAS\Refinery\Factory::$language
private

Definition at line 28 of file Factory.php.


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