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;
protected $defaultIncludes = [];
/**
* @var array
*/
protected $availableIncludes = [];
/**
* @param Activity $system_log
*
* @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
];
}
}