DatastoreDatastore   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
c 1
b 0
f 0
dl 0
loc 35
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getItemAttribute() 0 2 1
A parent() 0 3 1
A prop() 0 2 1
A datastore() 0 2 1
A page() 0 3 1
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