ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ObjectFacade.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
22 
25 use ilObject;
26 
32 {
34  protected int $ref_id;
35  protected int $obj_id;
38 
39  public function __construct(
40  InternalDataService $data_service,
41  InternalDomainService $domain_service,
42  int $ref_id,
43  int $obj_id = 0
44  ) {
45  $this->ref_id = $ref_id;
46  $this->obj_id = ($obj_id > 0)
47  ? $obj_id
48  : ilObject::_lookupObjId($ref_id);
49  $this->domain_service = $domain_service;
50  $this->object_manager = $domain_service->object($this->ref_id, $obj_id);
51  }
52 
57  public function cloneTo(int $obj_id): void
58  {
59  $this->object_manager->cloneTo($obj_id);
60  }
61 
66  public function getEffectiveStyleId(): int
67  {
68  return $this->object_manager->getEffectiveStyleId();
69  }
70 
77  public function getStyleId(): int
78  {
79  return $this->object_manager->getStyleId();
80  }
81 
87  public function updateStyleId(int $style_id): void
88  {
89  $this->object_manager->updateStyleId($style_id);
90  }
91 
95  public function inheritFromParent(): void
96  {
97  $this->object_manager->inheritFromParent();
98  }
99 }
getEffectiveStyleId()
This ID must be used when rendering the object (pages).
External facade for object content styles.
Manages repository object related content style behaviour.
__construct(InternalDataService $data_service, InternalDomainService $domain_service, int $ref_id, int $obj_id=0)
static _lookupObjId(int $ref_id)
inheritFromParent()
Inherits a non local style from the parent container.
object(int $ref_id, int $obj_id=0)
Objects without ref id (e.g.
getStyleId()
Get the style ID currently set (stored) by the object.
cloneTo(int $obj_id)
This must be called on cloning the parent object, with passing the object id of the clone...
updateStyleId(int $style_id)
Calling this should usually be avoided, currently this is necessary on import routines, but otherwise updates should be called internally automatically.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...