DatastoreDatastore::page()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace Phpsa\Datastore\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
use Phpsa\Datastore\Models\Datastore as DatastoreModel;
7
class DatastoreDatastore extends Model
8
{
9
	//
10
	protected $table = 'datastore_datastore';
11
12
	public $timestamps = false;
13
14
15
	protected $fillable = [
16
		'datastore_id',
17
		'datastore2_id'
18
	];
19
20
21
	public function parent()
22
    {
23
        return $this->belongsTo(DatastoreModel::class, 'datastore2_id');
24
	}
25
26
	public function page()
27
	{
28
		return $this->hasOne(DatastorePages::class, 'asset', 'datastore_id');
29
	}
30
31
32
	public function datastore(){
33
		return $this->belongsTo(DatastoreModel::class, 'datastore_id');
34
	}
35
36
	public function getItemAttribute(){
37
		return $this->datastore->datastore;
38
	}
39
40
	public function prop($key){
41
		return $this->item->prop($key);
0 ignored issues
show
Bug introduced by
The method prop() does not exist on null. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

41
		return $this->item->/** @scrutinizer ignore-call */ prop($key);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
42
	}
43
44
}
45