Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
100.00% |
1 / 1 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
2 / 2 |
| ProcessStatus | |
100.00% |
1 / 1 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
2 / 2 |
| resolveRouteBinding | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
| serializeDate | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
| 1 | <?php |
| 2 | |
| 3 | namespace Qmp\Laravel\AsyncProcessFactory\Model; |
| 4 | |
| 5 | class ProcessStatus extends \Moloquent |
| 6 | { |
| 7 | /** |
| 8 | * Undocumented variable |
| 9 | * |
| 10 | * @var string |
| 11 | */ |
| 12 | protected $connection = 'processMongo'; |
| 13 | |
| 14 | /** |
| 15 | * Undocumented variable |
| 16 | * |
| 17 | * @var string |
| 18 | */ |
| 19 | protected $collection = 'status'; |
| 20 | |
| 21 | /** |
| 22 | * Undocumented variable |
| 23 | * |
| 24 | * @var string |
| 25 | */ |
| 26 | protected $primaryKey = 'id'; |
| 27 | |
| 28 | /** |
| 29 | * Undocumented variable |
| 30 | * |
| 31 | * @var array |
| 32 | */ |
| 33 | protected $guarded = ['_id']; |
| 34 | |
| 35 | /** |
| 36 | * Undocumented variable |
| 37 | * |
| 38 | * @var array |
| 39 | */ |
| 40 | protected $hidden = ['_id']; |
| 41 | |
| 42 | /** |
| 43 | * Undocumented function |
| 44 | * |
| 45 | * @param [type] $value |
| 46 | * @return void |
| 47 | */ |
| 48 | public function resolveRouteBinding($value, $field = null) |
| 49 | { |
| 50 | return $this->where('id', $value)->first() ?? abort(422, 'Datas not found'); |
| 51 | } |
| 52 | |
| 53 | /** |
| 54 | * Prepare a date for array / JSON serialization. |
| 55 | * |
| 56 | * @param \DateTimeInterface $date |
| 57 | * @return string |
| 58 | */ |
| 59 | protected function serializeDate(\DateTimeInterface $date) |
| 60 | { |
| 61 | return $date->format('Y-m-d H:i:s'); |
| 62 | } |
| 63 | } |