1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00
invoiceninja/app/Transformers/SystemLogTransformer.php

40 lines
1.1 KiB
PHP
Raw Normal View History

2020-08-24 04:45:53 +02:00
<?php
namespace App\Transformers;
use App\Models\SystemLog;
use App\Utils\Traits\MakesHash;
class SystemLogTransformer extends EntityTransformer
{
use MakesHash;
2023-08-21 03:29:31 +02:00
protected array $defaultIncludes = [];
2020-08-24 04:45:53 +02:00
/**
* @var array
*/
2023-08-21 03:29:31 +02:00
protected array $availableIncludes = [];
2020-08-24 04:45:53 +02:00
/**
2020-10-28 11:10:49 +01:00
* @param SystemLog $system_log
2020-08-24 04:45:53 +02:00
*
* @return array
*/
public function transform(SystemLog $system_log)
{
return [
'id' => (string) $this->encodePrimaryKey($system_log->id),
'company_id' => (string) $this->encodePrimaryKey($system_log->company_id),
'user_id' => (string) $this->encodePrimaryKey($system_log->user_id),
'client_id' => (string) $this->encodePrimaryKey($system_log->client_id),
'event_id' => (int) $system_log->event_id,
'category_id' => (int) $system_log->category_id,
'type_id' => (int) $system_log->type_id,
2020-08-25 13:40:34 +02:00
'log' => json_encode($system_log->log),
'updated_at' => (int) $system_log->updated_at,
'created_at' => (int) $system_log->created_at,
2020-08-24 04:45:53 +02:00
];
}
}