ILIAS  release_7 Revision v7.30-3-g800a261c036
AbstractChildItem.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
25
30abstract class AbstractChildItem extends AbstractBaseItem implements isItem, isChild
31{
36 protected $parent;
37
41 public function withParent(IdentificationInterface $identification) : isItem
42 {
43 $clone = clone $this;
44 $clone->parent = $identification;
45
46 return $clone;
47 }
48
52 public function hasParent() : bool
53 {
54 return ($this->parent instanceof IdentificationInterface);
55 }
56
61 {
62 return $this->parent;
63 }
64
68 public function overrideParent(IdentificationInterface $identification) : isChild
69 {
70 $this->parent = $identification;
71
72 return $this;
73 }
74}
An exception for terminatinating execution or to throw for unit testing.
overrideParent(IdentificationInterface $identification)
@inheritDoc
withParent(IdentificationInterface $identification)
@inheritDoc