19 declare(strict_types=1);
33 public function __construct(
int $a_id = 0,
bool $a_reference =
true)
40 $this->content_style_domain = $DIC->contentStyle()
46 if (null === $this->objTrans && $this->
getId() > 0) {
68 $this->type = self::OBJ_TYPE;
74 parent::doCloneObject($new_obj, $a_target_id, $a_copy_id);
78 $ot->copy($new_obj->
getId());
80 $new_ot->setObjId($new_obj->
getId());
81 $new_obj->objTrans = $new_ot;
85 foreach ($translations as $language) {
87 $copiedXML = $originalPageObject->copyXmlContent();
90 $duplicatePageObject->setId($new_obj->
getId());
91 $duplicatePageObject->setParentId($new_obj->
getId());
92 $duplicatePageObject->setLanguage($language);
93 $duplicatePageObject->setXMLContent($copiedXML);
94 $duplicatePageObject->createFromXML();
96 $this->pageMetricsService->store(
99 $duplicatePageObject->getLanguage()
105 $style = $this->content_style_domain->styleForObjId($this->
getId());
106 $style->cloneTo($new_obj->
getId());
119 $lpSettings->cloneSettings($new_obj->
getId());
123 if (!$cwo->isRootNode($this->getRefId())) {
139 protected function doCreate(
bool $clone_mode =
false): void
141 parent::doCreate($clone_mode);
145 $this->db->manipulateF(
146 'INSERT INTO content_page_data (content_page_id, stylesheet ) VALUES(%s, %s)',
147 [
'integer',
'integer'],
162 $trans->setDefaultTitle($this->
getTitle());
175 $originalPageObject->delete();
179 $this->objTrans->delete();
181 $this->db->manipulateF(
182 'DELETE FROM content_page_metrics WHERE content_page_id = %s',
187 $this->db->manipulateF(
188 'DELETE FROM content_page_data WHERE content_page_id = %s',
201 $sql =
'SELECT DISTINCT page_id FROM page_object WHERE parent_id = %s AND parent_type = %s';
202 $res = $this->db->queryF(
208 while ($row = $this->db->fetchAssoc(
$res)) {
209 $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.
initPageMetricsService(ILIAS\Refinery\Factory $refinery)
static lookupTranslations(string $a_parent_type, int $a_id)
Lookup translations.
static _lookupContainerSetting(int $a_id, string $a_keyword, string $a_default_value=null)
PageMetricsService $pageMetricsService
static _tracProgress(int $a_user_id, int $a_obj_id, int $a_ref_id, string $a_obj_type='')
static _exists(string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
Checks whether page exists.
static getInstance(int $obj_id)
trackProgress(int $usrId)
setOfflineStatus(bool $status)
static _writeContainerSetting(int $a_id, string $a_keyword, string $a_value)
ilObjectTranslation $objTrans
__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)
__construct(int $a_id=0, bool $a_reference=true)