Availability   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 23
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getTable() 0 3 1
A property() 0 3 1
1
<?php
2
3
namespace IproSync\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
use Illuminate\Database\Eloquent\Relations\BelongsTo;
7
8
/**
9
 * @property \JsonFieldCast\Json\ArrayOfJsonObjectsField $availability
10
 * @property \JsonFieldCast\Json\SimpleJsonField $day_availability
11
 */
12
class Availability extends Model
13
{
14
    use HasTraitsWithCasts, HasPullAt;
15
16
    protected $primaryKey = 'property_id';
17
18
    public $incrementing = false;
19
20
    protected $guarded = [];
21
22
    protected $casts = [
23
        'availability'     => \JsonFieldCast\Casts\ArrayOfJsonObjectsField::class,
24
        'day_availability' => \JsonFieldCast\Casts\SimpleJsonField::class,
25
    ];
26
27
    public function getTable(): string
28
    {
29
        return config('iprosoftware-sync.tables.availabilities');
30
    }
31
32
    public function property(): BelongsTo
33
    {
34
        return $this->belongsTo(Property::class, 'property_id', 'id');
35
    }
36
}
37