ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
Factory.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 2017 Richard Klees <richard.klees@concepts-and-training.de> Extended GPL, see docs/LICENSE */
3 
4 namespace ILIAS\Data;
5 
14 class Factory
15 {
19  private $colorfactory;
20 
27  public function ok($value)
28  {
29  return new Result\Ok($value);
30  }
31 
38  public function error($e)
39  {
40  return new Result\Error($e);
41  }
42 
50  public function color($value)
51  {
52  if (!$this->colorfactory) {
53  $this->colorfactory = new Color\Factory();
54  }
55  return $this->colorfactory->build($value);
56  }
57 
62  public function clientId($clientId)
63  {
64  return new ClientId($clientId);
65  }
66 }
color($value)
Color is a data type representing a color in HTML.
Definition: Factory.php:50
error($e)
Get an error result.
Definition: Factory.php:38
$colorfactory
cache for color factory.
Definition: Factory.php:19
Builds data types.
Definition: Factory.php:14
ok($value)
Get an ok result.
Definition: Factory.php:27
clientId($clientId)
Definition: Factory.php:62