ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
Field.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
23class Field
24{
28 public function __construct(
29 protected string $name,
30 protected Description $type,
31 ) {
32 if (preg_match("/^[a-zA-Z](\w|_)+$/", $this->name) !== 1) {
33 throw new \InvalidArgumentException("Expected name to match [a-zA-Z](\w|_)+, got \"$name\"");
34 }
35 }
36
37 public function getName(): string
38 {
39 return $this->name;
40 }
41
42 public function getType(): Description
43 {
44 return $this->type;
45 }
46}
This describes some datastructure in terms of standard data structures such as primitives,...
Definition: Description.php:33
__construct(protected string $name, protected Description $type,)
Definition: Field.php:28