ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
AbstractChildItem.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
24 
29 abstract class AbstractChildItem extends AbstractBaseItem implements isItem, isChild
30 {
31  protected ?IdentificationInterface $parent = null;
32 
36  public function withParent(IdentificationInterface $identification): isItem
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;
58  }
59 
63  public function overrideParent(IdentificationInterface $identification): isChild
64  {
65  $this->parent = $identification;
66 
67  return $this;
68  }
69 }
overrideParent(IdentificationInterface $identification)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
withParent(IdentificationInterface $identification)