Files
w4rpservices/app/Console/Commands/Library/helper.php
drkthunder02 8bbd83da90 added fleet activity model
created new commands helper class to help with certain task across all scheduled task
updated the task to use the new class
partially updated fleet controller
2018-12-03 13:00:58 -06:00

41 lines
892 B
PHP

<?php
namespace Commands\Library;
use DB;
use Carbon\Carbon;
class CommandHelper {
private $job_name;
private $job_state;
private $system_time;
public function __construct($name) {
$this->job_name = $name;
$this->job_status = 'Starting';
$this->system_time = Carbon::now();
}
public function SetStartStatus() {
//Add an entry into the jobs table
$job = new ScheduleJob;
$job->job_name = $this->job_name;
$job->state = $this->job_state;
$job->system_time = $this->system_time;
$job->save();
}
public function SetStopStatus() {
//Mark the job as finished
DB::table('schedule_jobs')->where([
'system_time' => $this->system_time,
'job_name' => $this->job_name,
])->update([
'job_state' => 'Finished',
]);
}
}
?>