ILIAS  release_7 Revision v7.30-3-g800a261c036
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 
25 
30 abstract 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 
60  public function getParent() : IdentificationInterface
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 }
overrideParent(IdentificationInterface $identification)
withParent(IdentificationInterface $identification)