Builds data types.
More...
◆ alphanumeric()
ILIAS\Data\Factory::alphanumeric |
( |
|
$value | ) |
|
◆ clientId()
ILIAS\Data\Factory::clientId |
( |
string |
$clientId | ) |
|
◆ closedFloatInterval()
ILIAS\Data\Factory::closedFloatInterval |
( |
float |
$minimum, |
|
|
float |
$maximum |
|
) |
| |
- Parameters
-
float | $minimum | |
float | $maximum | |
- Returns
- ClosedFloatInterval
Definition at line 184 of file Factory.php.
184 : ClosedFloatInterval
186 return new ClosedFloatInterval($minimum, $maximum);
◆ closedIntegerInterval()
ILIAS\Data\Factory::closedIntegerInterval |
( |
int |
$minimum, |
|
|
int |
$maximum |
|
) |
| |
- Parameters
-
- Returns
- ClosedIntegerInterval
Definition at line 164 of file Factory.php.
164 : ClosedIntegerInterval
166 return new ClosedIntegerInterval($minimum, $maximum);
◆ color()
ILIAS\Data\Factory::color |
( |
|
$value | ) |
|
Color is a data type representing a color in HTML.
Construct a color with a hex-value or list of RGB-values.
- Parameters
-
- Returns
- Color
Definition at line 55 of file Factory.php.
57 if (!$this->colorfactory) {
58 $this->colorfactory =
new Color\Factory();
60 return $this->colorfactory->build($value);
◆ dataSize()
ILIAS\Data\Factory::dataSize |
( |
|
$size, |
|
|
string |
$unit = null |
|
) |
| |
Represents the size of some data.
- Parameters
-
string | int | $size | string might be a string like "126 MB" |
- Exceptions
-
Definition at line 83 of file Factory.php.
References ILIAS\Data\DataSize\$abbreviations, and $size.
85 if (is_string(
$size)) {
87 if (!preg_match(
"/(\d+)\s*([a-zA-Z]+)/",
$size, $match)) {
88 throw \InvalidArgumentException(
"'$size' can't be interpreted as data size.");
90 return $this->
dataSize((
int) $match[1], $match[2]);
93 throw new \InvalidArgumentException(
94 "Expected second argument to be a unit for data, '$unit' is unknown." 98 return new DataSize(
$size * $unit_size, $unit_size);
dataSize($size, string $unit=null)
Represents the size of some data.
◆ dateFormat()
ILIAS\Data\Factory::dateFormat |
( |
| ) |
|
◆ error()
ILIAS\Data\Factory::error |
( |
|
$e | ) |
|
◆ ok()
ILIAS\Data\Factory::ok |
( |
|
$value | ) |
|
Get an ok result.
- Parameters
-
- Returns
- Result
Definition at line 32 of file Factory.php.
34 return new Result\Ok($value);
◆ openedFloatInterval()
ILIAS\Data\Factory::openedFloatInterval |
( |
float |
$minimum, |
|
|
float |
$maximum |
|
) |
| |
- Parameters
-
float | $minimum | |
float | $maximum | |
- Returns
- Float
Definition at line 174 of file Factory.php.
174 : OpenedFloatInterval
176 return new OpenedFloatInterval($minimum, $maximum);
◆ openedIntegerInterval()
ILIAS\Data\Factory::openedIntegerInterval |
( |
int |
$minimum, |
|
|
int |
$maximum |
|
) |
| |
- Parameters
-
- Returns
- OpenedIntegerInterval
Definition at line 154 of file Factory.php.
154 : OpenedIntegerInterval
156 return new OpenedIntegerInterval($minimum, $maximum);
◆ password()
ILIAS\Data\Factory::password |
( |
|
$pass | ) |
|
◆ positiveInteger()
ILIAS\Data\Factory::positiveInteger |
( |
int |
$value | ) |
|
◆ refId()
ILIAS\Data\Factory::refId |
( |
int |
$ref_id | ) |
|
◆ uri()
ILIAS\Data\Factory::uri |
( |
|
$uri_string | ) |
|
Object representing an uri valid according to RFC 3986 with restrictions imposed on valid characters and obliagtory parts.
- Parameters
-
- Returns
- URI
Definition at line 71 of file Factory.php.
73 return new URI($uri_string);
◆ $colorfactory
ILIAS\Data\Factory::$colorfactory |
|
private |
cache for color factory.
Definition at line 24 of file Factory.php.
The documentation for this class was generated from the following file: