1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-14 15:13:29 +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
*
2023-01-28 23:21:40 +01:00
* @copyright Copyright (c) 2023. 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,
'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,
2023-02-17 10:43:00 +01:00
'remaining_cycles' => (int) $scheduler->remaining_cycles,
2022-05-25 00:06:42 +02:00
];
}
}