19 declare(strict_types=1);
34 public function __construct(
int $a_id = 0,
bool $a_reference =
true)
41 $this->content_style_domain = $DIC->contentStyle()
47 if (
null === $this->objTrans && $this->
getId() > 0) {
67 $this->type = self::OBJ_TYPE;
73 parent::doCloneObject($new_obj, $a_target_id, $a_copy_id);
77 $this->objTrans->copy($new_obj->
getId())
82 foreach ($translations as $language) {
84 $copiedXML = $originalPageObject->copyXmlContent();
87 $duplicatePageObject->setId($new_obj->
getId());
88 $duplicatePageObject->setParentId($new_obj->
getId());
89 $duplicatePageObject->setLanguage($language);
90 $duplicatePageObject->setXMLContent($copiedXML);
91 $duplicatePageObject->createFromXML();
93 $this->pageMetricsService->store(
96 $duplicatePageObject->getLanguage()
102 $style = $this->content_style_domain->styleForObjId($this->
getId());
103 $style->cloneTo($new_obj->
getId());
116 $lpSettings->cloneSettings($new_obj->
getId());
120 if (!$cwo->isRootNode($this->getRefId())) {
135 protected function doCreate(
bool $clone_mode =
false): void
137 parent::doCreate($clone_mode);
141 $this->db->manipulateF(
142 'INSERT INTO content_page_data (content_page_id, stylesheet ) VALUES(%s, %s)',
143 [
'integer',
'integer'],
149 )->storeCoreProperties();
154 $this->
lng->getDefaultLanguage(),
171 ->withDefaultTitle($this->
getTitle())
184 $originalPageObject->delete();
187 $this->db->manipulateF(
188 'DELETE FROM content_page_metrics WHERE content_page_id = %s',
193 $this->db->manipulateF(
194 'DELETE FROM content_page_data WHERE content_page_id = %s',
207 $sql =
'SELECT DISTINCT page_id FROM page_object WHERE parent_id = %s AND parent_type = %s';
208 $res = $this->db->queryF(
214 while ($row = $this->db->fetchAssoc(
$res)) {
215 $pageObjIds[] = (
int) $row[
'page_id'];
DomainService $content_style_domain
Facade for consumer domain interface.
cloneMetaData(ilObject $target_obj)
doCloneObject(ilObject2 $new_obj, int $a_target_id, ?int $a_copy_id=null)
Interface Observer Contains several chained tasks and infos about them.
Class handles translation mode for an object.
initPageMetricsService(ILIAS\Refinery\Factory $refinery)
static lookupTranslations(string $a_parent_type, int $a_id)
Lookup translations.
PageMetricsService $pageMetricsService
static _tracProgress(int $a_user_id, int $a_obj_id, int $a_ref_id, string $a_obj_type='')
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static _exists(string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
Checks whether page exists.
trackProgress(int $usrId)
setOfflineStatus(bool $status)
static _writeContainerSetting(int $a_id, string $a_keyword, string $a_value)
__construct(Container $dic, ilPlugin $plugin)
doCreate(bool $clone_mode=false)
getLongDescription()
get object long description (stored in object_description)
const INFO_TAB_VISIBILITY
static _getInstance(int $a_copy_id)
static _lookupContainerSetting(int $a_id, string $a_keyword, ?string $a_default_value=null)
__construct(int $a_id=0, bool $a_reference=true)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...