ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
Factory.php
Go to the documentation of this file.
1 <?php
2 declare(strict_types=1);
3 
4 /* Copyright (c) 1998-2019 ILIAS open source, Extended GPL, see docs/LICENSE */
5 
10 namespace ILIAS\Refinery;
11 
14 
15 class Factory
16 {
20  private $dataFactory;
21 
25  private $language;
26 
31  public function __construct(\ILIAS\Data\Factory $dataFactory, \ilLanguage $language)
32  {
33  $this->dataFactory = $dataFactory;
34  $this->language = $language;
35 
36  $this->language->loadLanguageModule('validation');
37  }
38 
45  public function to() : To\Group
46  {
47  return new To\Group($this->dataFactory);
48  }
49 
57  public function in() : In\Group
58  {
59  return new In\Group();
60  }
61 
68  public function int() : Integer\Group
69  {
70  return new Integer\Group($this->dataFactory, $this->language);
71  }
72 
78  public function string() : String\Group
79  {
80  return new String\Group($this->dataFactory, $this->language);
81  }
82 
88  public function custom() : Custom\Group
89  {
90  return new Custom\Group($this->dataFactory, $this->language);
91  }
92 
98  public function container()
99  {
100  return new Container\Group($this->dataFactory, $this->language);
101  }
102 
108  public function password()
109  {
110  return new Password\Group($this->dataFactory, $this->language);
111  }
112 
118  public function logical()
119  {
120  return new Logical\Group($this->dataFactory, $this->language);
121  }
122 
128  public function null()
129  {
130  return new IsNull($this->dataFactory, $this->language);
131  }
132 
138  public function numeric()
139  {
140  return new Numeric\Group($this->dataFactory, $this->language);
141  }
142 
148  public function dateTime()
149  {
150  return new DateTime\Group();
151  }
152 
158  public function uri() : URI\Group
159  {
160  return new URI\Group();
161  }
162 }
custom()
Contains constraints and transformations for custom functions.
Definition: Factory.php:88
in()
Creates a factory object to create a transformation object, that can be used to execute other transfo...
Definition: Factory.php:57
null()
Contains constraints for null types.
Definition: Factory.php:128
logical()
Contains constraints for logical compositions with other constraints.
Definition: Factory.php:118
Class ChatMainBarProvider .
numeric()
Contains constraints for numeric data types.
Definition: Factory.php:138
container()
Contains constraints for container types (e.g.
Definition: Factory.php:98
password()
Contains constraints for password strings.
Definition: Factory.php:108
__construct(\ILIAS\Data\Factory $dataFactory, \ilLanguage $language)
Definition: Factory.php:31
The scope of this class is split ilias-conform URI&#39;s into components.
Definition: URI.php:17
dateTime()
Contains transformations for DateTime.
Definition: Factory.php:148
Builds data types.
Definition: Factory.php:19
uri()
Contains transformations for Data.
Definition: Factory.php:158
int()
Contains constraints and transformations on numbers.
Definition: Factory.php:68
to()
Combined validations and transformations for primitive data types that establish a baseline for furth...
Definition: Factory.php:45
language handling
language()
Definition: language.php:2
string()
Contains constraints for string.
Definition: Factory.php:78