ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
AbstractChildItem.php
Go to the documentation of this file.
2
5
11abstract class AbstractChildItem extends AbstractBaseItem implements isChild
12{
13
17 protected $parent;
18
19
23 public function withParent(IdentificationInterface $identification) : isItem
24 {
25 $clone = clone($this);
26 $clone->parent = $identification;
27
28 return $clone;
29 }
30
31
35 public function hasParent() : bool
36 {
37 return ($this->parent instanceof IdentificationInterface);
38 }
39
40
45 {
46 return $this->parent instanceof IdentificationInterface ? $this->parent : new NullIdentification();
47 }
48
49
53 public function overrideParent(IdentificationInterface $identification) : isChild
54 {
55 $this->parent = $identification;
56
57 return $this;
58 }
59}
An exception for terminatinating execution or to throw for unit testing.
withParent(IdentificationInterface $identification)
@inheritDoc
overrideParent(IdentificationInterface $identification)
@inheritDoc