ILIAS  release_8 Revision v8.24
AbstractChildItem.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
21
24
29abstract class AbstractChildItem extends AbstractBaseItem
30{
32
36 public function withParent(IdentificationInterface $identification): self
37 {
38 $clone = clone($this);
39 $clone->parent = $identification;
40
41 return $clone;
42 }
43
47 public function hasParent(): bool
48 {
49 return $this->parent instanceof IdentificationInterface;
50 }
51
56 {
57 return $this->parent instanceof IdentificationInterface ? $this->parent : new NullIdentification();
58 }
59
60 public function overrideParent(IdentificationInterface $identification): isItem
61 {
62 $this->parent = $identification;
63
64 return $this;
65 }
66}
withParent(IdentificationInterface $identification)
@inheritDoc
overrideParent(IdentificationInterface $identification)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...