ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
class.ilPair.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
23 use ILIAS\Export\ImportHandler\I\File\XML\Node\Info\Attribute\ilPairInterface as ilXMLFileNodeInfoAttributePairInterface;
24 
25 class ilPair implements ilXMLFileNodeInfoAttributePairInterface
26 {
27  protected string $key;
28  protected string $value;
29 
30  public function __construct()
31  {
32  $this->key = '';
33  $this->value = '';
34  }
35 
36  public function withValue(string $value): ilXMLFileNodeInfoAttributePairInterface
37  {
38  $clone = clone $this;
39  $clone->value = $value;
40  return $clone;
41  }
42 
43  public function withKey(string $key): ilXMLFileNodeInfoAttributePairInterface
44  {
45  $clone = clone $this;
46  $clone->key = $key;
47  return $clone;
48  }
49 
50  public function getKey(): string
51  {
52  return $this->key;
53  }
54 
55  public function getValue(): string
56  {
57  return $this->value;
58  }
59 }