◆ __construct()
ilAdvancedMDRecordExportFiles::__construct |
( |
int |
$user_id, |
|
|
?ObjectId |
$a_obj_id = null |
|
) |
| |
◆ create()
ilAdvancedMDRecordExportFiles::create |
( |
string |
$a_xml | ) |
|
Definition at line 67 of file class.ilAdvancedMDRecordExportFiles.php.
69 : void {
70 $file_name = time() . '.xml';
71 $stream = Streams::ofString($a_xml);
72 if (is_null($this->object_id)) {
73 $this->amd_record_file_factory->handler()->addGlobalFile(
74 $this->user_id,
75 $file_name,
76 $stream
77 );
78 }
79 if (!is_null($this->object_id)) {
80 $this->amd_record_file_factory->handler()->addFile(
81 $this->object_id,
82 $this->user_id,
83 $file_name,
84 $stream
85 );
86 }
87 }
◆ deleteByFileId()
ilAdvancedMDRecordExportFiles::deleteByFileId |
( |
int |
$user_id, |
|
|
string |
$file_id |
|
) |
| |
Definition at line 108 of file class.ilAdvancedMDRecordExportFiles.php.
111 : bool {
112 $global = is_null($this->object_id);
113 if ($global) {
114 $this->amd_record_file_factory->handler()->deleteGlobal(
116 $file_id
117 );
118 }
119 if (!$global) {
120 $this->amd_record_file_factory->handler()->delete(
121 $this->object_id,
123 $file_id
124 );
125 }
126 return true;
127 }
References $user_id.
◆ download()
ilAdvancedMDRecordExportFiles::download |
( |
string |
$file_id, |
|
|
string|null |
$filename_overwrite = null |
|
) |
| |
Definition at line 89 of file class.ilAdvancedMDRecordExportFiles.php.
92 : void {
93 if (is_null($this->object_id)) {
94 $this->amd_record_file_factory->handler()->downloadGlobal(
95 $file_id,
96 $filename_overwrite
97 );
98 }
99 if (!is_null($this->object_id)) {
100 $this->amd_record_file_factory->handler()->download(
101 $this->object_id,
102 $file_id,
103 $filename_overwrite
104 );
105 }
106 }
◆ readFilesInfo()
ilAdvancedMDRecordExportFiles::readFilesInfo |
( |
| ) |
|
- Returns
- array array e.g array(records => 'ECS-Server',size => '123',created' => 121212)
Definition at line 52 of file class.ilAdvancedMDRecordExportFiles.php.
52 : array
53 {
54 $file_info = [];
55 $elements = is_null($this->object_id)
56 ? $this->amd_record_file_factory->handler()->getGlobalFiles()
57 : $this->amd_record_file_factory->handler()->getFilesByObjectId($this->object_id);
58 foreach ($elements as $element) {
59 $file_id = $element->getIRSS()->getResourceIdSerialized();
60 $file_info[$file_id][
self::SIZE] = $element->getIRSS()->getResourceSize();
61 $file_info[$file_id][
self::DATE] = $element->getIRSS()->getCreationDate()->getTimestamp();
62 $file_info[$file_id][
self::NAME] = $element->getIRSS()->getRecords();
63 }
64 return $file_info;
65 }
References DATE, NAME, and SIZE.
◆ $amd_record_file_factory
ilAMDRecordFileFactory ilAdvancedMDRecordExportFiles::$amd_record_file_factory |
|
protected |
◆ $export_dir
string ilAdvancedMDRecordExportFiles::$export_dir = '' |
|
protected |
◆ $object_id
ObjectId null ilAdvancedMDRecordExportFiles::$object_id |
|
protected |
◆ $user_id
int ilAdvancedMDRecordExportFiles::$user_id |
|
protected |
◆ DATE
const ilAdvancedMDRecordExportFiles::DATE = 'date' |
|
protected |
◆ NAME
const ilAdvancedMDRecordExportFiles::NAME = 'name' |
|
protected |
◆ SIZE
const ilAdvancedMDRecordExportFiles::SIZE = 'size' |
|
protected |
The documentation for this class was generated from the following file: