ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
Manipulator.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
26 
28 {
30  protected SetInterface $set;
31 
32  public function __construct(
33  InternalManipulator $internal_manipulator,
34  SetInterface $set
35  ) {
36  $this->internal_manipulator = $internal_manipulator;
37  $this->set = $set;
38  }
39 
40  public function prepareCreateOrUpdate(
42  string ...$values
44  $set = $this->internal_manipulator->prepareCreateOrUpdate(
45  $this->set,
46  $path,
47  ...$values
48  );
49  return $this->getCloneWithNewSet($set);
50  }
51 
52  public function prepareForceCreate(
54  string ...$values
56  $set = $this->internal_manipulator->prepareForceCreate(
57  $this->set,
58  $path,
59  ...$values
60  );
61  return $this->getCloneWithNewSet($set);
62  }
63 
65  {
66  $set = $this->internal_manipulator->prepareDelete(
67  $this->set,
68  $path
69  );
70  return $this->getCloneWithNewSet($set);
71  }
72 
73  public function execute(): void
74  {
75  $this->internal_manipulator->execute($this->set);
76  }
77 
79  {
80  $clone = clone $this;
81  $clone->set = $set;
82  return $clone;
83  }
84 }
$path
Definition: ltiservices.php:32
prepareDelete(PathInterface $path)
All elements specified by the path are set to be deleted.
Definition: Manipulator.php:64
__construct(InternalManipulator $internal_manipulator, SetInterface $set)
Definition: Manipulator.php:32
execute()
Execute all prepared actions.
Definition: Manipulator.php:73
prepareForceCreate(PathInterface $path, string ... $values)
New elements are set to be created as specified by the path, and are filled with the values...
Definition: Manipulator.php:52
prepareCreateOrUpdate(PathInterface $path, string ... $values)
The values are set to be inserted into the elements specified by the path in order.
Definition: Manipulator.php:40