ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
Factory.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 2019 Nils Haagen <nils.haagen@concepts-and-training.de> Extended GPL, see docs/LICENSE */
3
5
9class Factory
10{
14 protected $builder;
15
17 {
18 $this->builder = $builder;
19 }
20
25 public function standard() : DateFormat
26 {
27 return $this->builder->year()->dash()->month()->dash()->day()->get();
28 }
29
34 public function custom() : FormatBuilder
35 {
36 return $this->builder;
37 }
38
42 public function germanShort() : DateFormat
43 {
44 return $this->builder->day()->dot()->month()->dot()->year()->get();
45 }
46
50 public function germanLong() : DateFormat
51 {
52 return $this->builder->weekday()->comma()->space()
53 ->day()->dot()->month()->dot()->year()->get();
54 }
55}
An exception for terminatinating execution or to throw for unit testing.
Factory for Date Formats.
Definition: Factory.php:10
standard()
Get the ISO 8601 date format (YYYY-MM-DD)
Definition: Factory.php:25
__construct(FormatBuilder $builder)
Definition: Factory.php:16
custom()
Get the builder to define a custom DateFormat.
Definition: Factory.php:34
Builds a Date Format with split up elements to ease conversion.