Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| SchedulerJobModel | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
| findByName | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Modules\SchedulerModule\Models; |
| 4 | |
| 5 | use CodeIgniter\Model; |
| 6 | use App\Modules\SchedulerModule\Entities\SchedulerJobEntity; |
| 7 | |
| 8 | class SchedulerJobModel extends Model |
| 9 | { |
| 10 | protected $table = 'scheduler_job'; |
| 11 | protected $primaryKey = 'id'; |
| 12 | |
| 13 | protected $returnType = SchedulerJobEntity::class; |
| 14 | |
| 15 | protected $allowedFields = [ |
| 16 | 'name', |
| 17 | 'description', |
| 18 | 'command', |
| 19 | 'schedule', |
| 20 | 'enabled', |
| 21 | 'default_limit', |
| 22 | 'created_at', |
| 23 | 'updated_at', |
| 24 | ]; |
| 25 | |
| 26 | protected $useTimestamps = true; |
| 27 | |
| 28 | public function findByName(string $name) |
| 29 | { |
| 30 | return $this->where('name', $name)->first(); |
| 31 | } |
| 32 | } |