Availability::property()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
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