2017-01-30 20:40:43 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Ninja\Import\FreshBooks;
|
2015-11-18 15:40:50 +01:00
|
|
|
|
2015-12-08 11:10:20 +01:00
|
|
|
use App\Ninja\Import\BaseTransformer;
|
2015-11-18 15:40:50 +01:00
|
|
|
|
|
|
|
/*
|
2015-12-08 11:10:20 +01:00
|
|
|
class TaskTransformer extends BaseTransformer
|
2015-11-18 15:40:50 +01:00
|
|
|
{
|
|
|
|
|
|
|
|
public function transform($data)
|
|
|
|
{
|
|
|
|
// start by converting to seconds
|
|
|
|
$seconds = ($data->hours * 3600);
|
|
|
|
$timeLogFinish = strtotime($data->date);
|
|
|
|
$timeLogStart = intval($timeLogFinish - $seconds);
|
|
|
|
$timeLog[] = [];
|
|
|
|
$timelog[] = $timeLogStart;
|
|
|
|
$timelog[] = $timeLogFinish;
|
|
|
|
$timeLog = json_encode(array($timelog));
|
|
|
|
|
|
|
|
return [
|
|
|
|
'action' => 'stop',
|
|
|
|
'time_log' => $timeLog,
|
|
|
|
'description' => $data->task,
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2017-01-30 17:05:31 +01:00
|
|
|
*/
|