ILIAS  trunk Revision v11.0_alpha-2658-ge2404539063
Field.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 namespace ILIAS\Data\Description;
22 
23 class 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 }
__construct(protected string $name, protected Description $type,)
Definition: Field.php:28
This describes some datastructure in terms of standard data structures such as primitives, lists, maps and objects and helpful (hopefully...) human readable texts.
Definition: Description.php:32