19declare(strict_types=1);
28 $mob->setTitle(
$value[self::FILE_NAME]);
30 $mob->createDirectory();
33 if ($has_save_confirmation) {
35 $this->
http->wrapper()->post()->retrieve(
'ilfilehash', $this->refinery->kindlyTo()->string()),
36 'field_' . $this->getField()->getId(),
40 $this->
getField()->getFileSystem()->write($target_file_path .
'/' . str_replace(
' ',
'_',
$value[self::FILE_NAME]), file_get_contents($move_file));
46 $format = $this->
getField()->getFileSystem()->getMimeType($file->getPath());
51 $this->getRecord()->getTable()->getCollectionObject()->getId()
54 $media_item->setPurpose(
'Standard');
55 $media_item->setFormat($format);
56 $media_item->setLocation(basename($file->getPath()));
57 $media_item->setLocationType(
'LocalFile');
58 $mob->addMediaItem($media_item);
77 if (is_numeric($file)) {
79 return $mob->getTitle();
93 return $mob->getTitle();
107 if ($this->value !==
null) {
111 $path = $origin::_getRelativeDirectory($origin->getId()) .
'/' . $origin->getTitle();
113 $new = $origin->duplicate();
114 $new->createDirectory();
115 $new_path = $origin::_getRelativeDirectory($new->getId()) .
'/' . $new->getTitle();
setValue($value, bool $omit_parsing=false)
Set value for record field.
doUpdate()
Update object in database.
@noinspection AutoloadingIssuesInspection
parseExportValue($value)
Function to parse incoming data from form input value $value.
handleFileUpload(array $value, bool $has_save_confirmation)
parseSortingValue($value, bool $link=true)
Returns sortable value for the specific field-types.
static enabled()
Checks, whether FFmpeg support is enabled (path is set in the setup)
static extractImage(string $a_file, string $a_target_filename, string $a_target_dir="", int $a_sec=1)
Extract image from video file.
static supportsImageExtraction(string $a_mime)
Check if mime type supports image extraction.
static http()
Fetches the global http state from ILIAS.