26 protected ?
bool $no_meta_data_creation = null;
31 $check_existing = $DIC->database()->queryF(
32 'SELECT file_id FROM file_data WHERE file_id = %s',
36 if ($check_existing->numRows() === 0) {
37 $DIC->database()->insert(
'file_data', $this->getArrayForDatabase());
39 $DIC->database()->update(
41 $this->getArrayForDatabase(),
42 [
'file_id' => [
'integer', $this->
getId()]]
59 if (isset($this->ref_id)) {
61 if ($default_visibility ===
"public") {
69 'meta_lifecycle_id' => [
'integer', $DIC->database()->nextId(
'il_meta_lifecycle')],
70 'rbac_id' => [
'integer', $this->
getId()],
71 'obj_id' => [
'integer', $this->
getId()],
72 'obj_type' => [
'text',
"file"],
73 'meta_version' => [
'integer', (
int) $this->getVersion()],
75 $DIC->database()->insert(
'il_meta_lifecycle', $metadata);
78 if ($this->getMode() !== self::MODE_FILELIST) {
79 $this->createMetaData();
85 $this->no_meta_data_creation = $a_status;
90 return !(bool) $this->no_meta_data_creation;
95 return !(bool) $this->no_meta_data_creation;
104 $md_obj =
new ilMD($this->
getId(), 0, $this->getType());
109 $format->setFormat($this->getFileType());
118 $md =
new ilMD($this->
getId(), 0, $this->getType());
119 if (!is_object($md_gen = $md->getGeneral())) {
122 $title = $this->appendSuffixToTitle($md_gen->getTitle(), $this->getFileName());
123 $md_gen->setTitle($title);
132 switch ($a_element) {
136 $md =
new ilMD($this->
getId(), 0, $this->getType());
137 if (!is_object($md_technical = $md->getTechnical())) {
141 foreach ($md_technical->getFormatIds() as
$id) {
142 $md_format = $md_technical->getFormat(
$id);
143 $this->setFileType($md_format->getFormat());
157 $md_obj =
new ilMD($this->
getId(), 0, $this->getType());
158 if (!is_object(
$technical = $md_obj->getTechnical())) {
165 if (count($format_ids) > 0) {
166 $format =
$technical->getFormat($format_ids[0]);
167 $format->setFormat($this->getFileType());
171 $format->setFormat($this->getFileType());
176 $meta_version_column = [
'meta_version' => [
'integer', (
int) $this->getVersion()]];
177 $DIC->database()->update(
'il_meta_lifecycle', $meta_version_column, [
190 $copyright_id = $this->getCopyrightID();
195 $md_obj =
new ilMD($this->
getId(), 0, $this->getType());
196 $rights = $md_obj->getRights();
198 $rights = $md_obj->addRights();
202 $rights->setCopyrightAndOtherRestrictions(
"Yes");
203 $rights->setDescription(
'il_copyright_entry__' .
IL_INST_ID .
'__' . $copyright_id);
static _getDefaultVisibilityForRefId(int $a_ref_id)
Get default visibility for reference id.
static _write(string $a_type, string $a_setting, string $a_value, int $a_user=0, int $a_block_id=0)
Write setting to database.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins