ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
AbstractChildItem.php
Go to the documentation of this file.
2 
5 
10 abstract class AbstractChildItem extends AbstractBaseItem
11 {
12 
16  protected $parent;
17 
21  public function withParent(IdentificationInterface $identification) : isItem
22  {
23  $clone = clone($this);
24  $clone->parent = $identification;
25 
26  return $clone;
27  }
28 
32  public function hasParent() : bool
33  {
34  return ($this->parent instanceof IdentificationInterface);
35  }
36 
40  public function getParent() : IdentificationInterface
41  {
42  return $this->parent instanceof IdentificationInterface ? $this->parent : new NullIdentification();
43  }
44 
48  public function overrideParent(IdentificationInterface $identification) : isChild
49  {
50  $this->parent = $identification;
51 
52  return $this;
53  }
54 }
withParent(IdentificationInterface $identification)
overrideParent(IdentificationInterface $identification)