ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
AbstractChildItem.php
Go to the documentation of this file.
2
5
10abstract class AbstractChildItem extends AbstractBaseItem
11{
12
16 protected $parent;
17
21 public function withParent(IdentificationInterface $identification) : isItem
22 {
23 $clone = clone($this);
24 $clone->parent = $identification;
25
26 return $clone;
27 }
28
32 public function hasParent() : bool
33 {
34 return ($this->parent instanceof IdentificationInterface);
35 }
36
41 {
42 return $this->parent instanceof IdentificationInterface ? $this->parent : new NullIdentification();
43 }
44
48 public function overrideParent(IdentificationInterface $identification) : isChild
49 {
50 $this->parent = $identification;
51
52 return $this;
53 }
54}
An exception for terminatinating execution or to throw for unit testing.
withParent(IdentificationInterface $identification)
@inheritDoc
overrideParent(IdentificationInterface $identification)
@inheritDoc