ILIAS  release_7 Revision v7.30-3-g800a261c036
Factory.php
Go to the documentation of this file.
1<?php
2declare(strict_types=1);
3
4/* Copyright (c) 1998-2019 ILIAS open source, Extended GPL, see docs/LICENSE */
5
10namespace ILIAS\Refinery;
11
15
17{
21 private $dataFactory;
22
26 private $language;
27
32 public function __construct(\ILIAS\Data\Factory $dataFactory, \ilLanguage $language)
33 {
34 $this->dataFactory = $dataFactory;
35 $this->language = $language;
36
37 $this->language->loadLanguageModule('validation');
38 }
39
46 public function to() : To\Group
47 {
48 return new To\Group($this->dataFactory);
49 }
50
62 public function kindlyTo() : KindlyTo\Group
63 {
64 return new KindlyTo\Group($this->dataFactory);
65 }
66
74 public function in() : In\Group
75 {
76 return new In\Group();
77 }
78
85 public function int() : Integer\Group
86 {
87 return new Integer\Group($this->dataFactory, $this->language);
88 }
89
95 public function string() : String\Group
96 {
97 return new String\Group($this->dataFactory, $this->language);
98 }
99
105 public function custom() : Custom\Group
106 {
107 return new Custom\Group($this->dataFactory, $this->language);
108 }
109
115 public function container()
116 {
117 return new Container\Group($this->dataFactory, $this->language);
118 }
119
125 public function password()
126 {
127 return new Password\Group($this->dataFactory, $this->language);
128 }
129
135 public function logical()
136 {
137 return new Logical\Group($this->dataFactory, $this->language);
138 }
139
145 public function null()
146 {
147 return new IsNull($this->dataFactory, $this->language);
148 }
149
155 public function numeric()
156 {
157 return new Numeric\Group($this->dataFactory, $this->language);
158 }
159
165 public function dateTime()
166 {
167 return new DateTime\Group();
168 }
169
175 public function uri() : URI\Group
176 {
177 return new URI\Group();
178 }
179
184 public function byTrying(array $transformations) : ByTrying
185 {
186 return new ByTrying($transformations, $this->dataFactory, $this->language);
187 }
188}
An exception for terminatinating execution or to throw for unit testing.
Builds data types.
Definition: Factory.php:20
The scope of this class is split ilias-conform URI's into components.
Definition: URI.php:18
container()
Contains constraints for container types (e.g.
Definition: Factory.php:115
custom()
Contains constraints and transformations for custom functions.
Definition: Factory.php:105
int()
Contains constraints and transformations on numbers.
Definition: Factory.php:85
password()
Contains constraints for password strings.
Definition: Factory.php:125
logical()
Contains constraints for logical compositions with other constraints.
Definition: Factory.php:135
in()
Creates a factory object to create a transformation object, that can be used to execute other transfo...
Definition: Factory.php:74
uri()
Contains transformations for Data\URI.
Definition: Factory.php:175
numeric()
Contains constraints for numeric data types.
Definition: Factory.php:155
byTrying(array $transformations)
Accepts Transformations and uses first successful one.
Definition: Factory.php:184
__construct(\ILIAS\Data\Factory $dataFactory, \ilLanguage $language)
Definition: Factory.php:32
string()
Contains constraints for string.
Definition: Factory.php:95
kindlyTo()
Combined validations and transformations for primitive data types that establish a baseline for furth...
Definition: Factory.php:62
to()
Combined validations and transformations for primitive data types that establish a baseline for furth...
Definition: Factory.php:46
dateTime()
Contains transformations for DateTime.
Definition: Factory.php:165
Transformations in this group transform data to primitive types to establish a baseline for more comp...
Definition: Group.php:33
language handling
language()
Definition: language.php:2
Class ChatMainBarProvider \MainMenu\Provider.