1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00
invoiceninja/app/Transformers/SchedulerTransformer.php

39 lines
1.2 KiB
PHP
Raw Normal View History

2022-05-25 00:06:42 +02:00
<?php
/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/
2022-05-25 00:06:42 +02:00
namespace App\Transformers;
use App\Models\Scheduler;
use App\Utils\Traits\MakesHash;
2023-01-13 02:43:38 +01:00
class SchedulerTransformer extends EntityTransformer
2022-05-25 00:06:42 +02:00
{
use MakesHash;
public function transform(Scheduler $scheduler)
{
return [
'id' => $this->encodePrimaryKey($scheduler->id),
2023-01-13 02:43:38 +01:00
'name' => (string) $scheduler->name,
'frequency_id' => (string) $scheduler->frequency_id,
2023-01-17 09:42:34 +01:00
'next_run' => $scheduler->next_run_client->format('Y-m-d'),
2023-01-13 02:43:38 +01:00
'template' => (string) $scheduler->template,
'is_paused' => (bool) $scheduler->is_paused,
'is_deleted' => (bool) $scheduler->is_deleted,
'parameters'=> (array) $scheduler->parameters,
'is_deleted' => (bool) $scheduler->is_deleted,
'updated_at' => (int) $scheduler->updated_at,
'created_at' => (int) $scheduler->created_at,
'archived_at' => (int) $scheduler->deleted_at,
2022-05-25 00:06:42 +02:00
];
}
}