ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
AbstractChildItem.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
25
30abstract class AbstractChildItem extends AbstractBaseItem
31{
33
37 public function withParent(IdentificationInterface $identification): self
38 {
39 $clone = clone($this);
40 $clone->parent = $identification;
41
42 return $clone;
43 }
44
48 public function hasParent(): bool
49 {
50 return $this->parent instanceof IdentificationInterface;
51 }
52
57 {
58 return $this->parent instanceof IdentificationInterface ? $this->parent : new NullIdentification();
59 }
60
61 public function overrideParent(IdentificationInterface $identification): isItem
62 {
63 $this->parent = $identification;
64
65 return $this;
66 }
67}
withParent(IdentificationInterface $identification)
@inheritDoc
overrideParent(IdentificationInterface $identification)