2024-10-16 17:32:15 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
function getFileData($file) {
|
|
|
|
|
$data = [
|
|
|
|
|
'url' => $file->url(),
|
|
|
|
|
'uuid' => (string) $file->uuid(),
|
|
|
|
|
'name' => $file->filename(),
|
2024-10-16 18:43:04 +02:00
|
|
|
'type' => (string) $file->type()
|
2024-10-16 17:32:15 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
|
|
if ($file->description()->exists()) {
|
2024-10-16 17:57:50 +02:00
|
|
|
$data['description'] = $file->description()->value();
|
2024-10-16 17:32:15 +02:00
|
|
|
$data['tags'] = $file->tags()->split();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return $data;
|
|
|
|
|
}
|