Files
CRM/app/ExportResources/Journal/JournalEntry.php
Kroonk a213a1dba0
Some checks failed
Build & Push Monica Image to Gitea Registry / build-and-push (push) Failing after 9s
refactor: replace custom CRM with Monica fork
2026-05-22 16:19:55 +02:00

51 lines
1.4 KiB
PHP

<?php
namespace App\ExportResources\Journal;
use App\ExportResources\ExportResource;
class JournalEntry extends ExportResource
{
protected $columns = [
'created_at',
'updated_at',
];
protected $properties = [
'date',
];
public function data(): ?array
{
$data = $this->getObjectData();
if ($data !== null) {
switch ($data['type']) {
case 'entry':
return [
'uuid' => $this->journalable->uuid,
'properties' => [
'type' => $data['type'],
'title' => $data['title'],
'post' => $data['post'],
'date' => $data['date'],
],
];
case 'day':
return [
'uuid' => $this->journalable->uuid,
'properties' => [
'type' => $data['type'],
'rate' => $data['rate'],
'comment' => $data['comment'],
'day' => $data['day'],
'month' => $data['month'],
'year' => $data['year'],
],
];
}
}
return null;
}
}