Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
| TblG3wLastUpdate | n/a |
0 / 0 |
n/a |
0 / 0 |
0 | n/a |
0 / 0 |
|||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Models; |
| 4 | |
| 5 | use Illuminate\Database\Eloquent\Factories\HasFactory; |
| 6 | use Illuminate\Database\Eloquent\Model; |
| 7 | |
| 8 | class TblG3wLastUpdate extends Model |
| 9 | { |
| 10 | use HasFactory; |
| 11 | |
| 12 | protected $table = 'tbl_g3w_last_update'; |
| 13 | |
| 14 | // The real primary key is `id`. `g3w_id` (last synced presupuesto ID) is |
| 15 | // not unique — every region that has never synced sits at 0 — so using it |
| 16 | // as the key made `$row->update()` on a row fetched by region write to |
| 17 | // every other region parked on the same g3w_id. |
| 18 | protected $primaryKey = 'id'; |
| 19 | |
| 20 | // The table has no `created_at` column, only `updated_at`. Without this an |
| 21 | // Eloquent insert tries to write created_at and blows up, which is why |
| 22 | // rows could only ever be created by hand. |
| 23 | const CREATED_AT = null; |
| 24 | |
| 25 | protected $fillable = [ |
| 26 | 'region', |
| 27 | 'g3w_id', |
| 28 | 'updatingNow', |
| 29 | 'updated_at', |
| 30 | 'modified_synced_until', |
| 31 | ]; |
| 32 | |
| 33 | protected $casts = [ |
| 34 | 'updated_at' => 'datetime', |
| 35 | 'modified_synced_until' => 'datetime', |
| 36 | ]; |
| 37 | } |