ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
canHaveParentTrait.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
24 
29 {
30  protected ?IdentificationInterface $parent = null;
31 
32  public function hasParent(): bool
33  {
34  return $this->parent !== null;
35  }
36 
38  {
39  return $this->parent;
40  }
41 
42  public function withParent(IdentificationInterface $identification): self
43  {
44  if ($this->parent !== null && $this->parent === $identification) {
45  return $this;
46  }
47 
48  $clone = clone $this;
49  $clone->parent = $identification;
50  return $clone;
51  }
52 }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
withParent(IdentificationInterface $identification)