| Total Complexity | 7 |
| Total Lines | 63 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 6 | class ModelRelation |
||
| 7 | { |
||
| 8 | private $type; |
||
| 9 | private $model; |
||
| 10 | private $localKey; |
||
| 11 | private $foreignKey; |
||
| 12 | private $name; |
||
| 13 | |||
| 14 | public function __construct($name, $type, $model, $localKey = null, $foreignKey) |
||
| 15 | { |
||
| 16 | $this->type = $type; |
||
| 17 | $this->model = $model; |
||
| 18 | $this->localKey = $localKey; |
||
| 19 | $this->foreignKey = $foreignKey; |
||
| 20 | $this->name = $name; |
||
| 21 | } |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @return mixed |
||
| 25 | */ |
||
| 26 | public function getModel() |
||
| 27 | { |
||
| 28 | return $this->model; |
||
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @return string |
||
| 33 | */ |
||
| 34 | public function getModelNodeName() |
||
| 35 | { |
||
| 36 | return Str::slug($this->model); |
||
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @return mixed |
||
| 41 | */ |
||
| 42 | public function getType() |
||
| 43 | { |
||
| 44 | return $this->type; |
||
| 45 | } |
||
| 46 | |||
| 47 | /** |
||
| 48 | * @return null |
||
| 49 | */ |
||
| 50 | public function getLocalKey() |
||
| 53 | } |
||
| 54 | |||
| 55 | /** |
||
| 56 | * @return mixed |
||
| 57 | */ |
||
| 58 | public function getForeignKey() |
||
| 59 | { |
||
| 60 | return $this->foreignKey; |
||
| 61 | } |
||
| 62 | |||
| 63 | /** |
||
| 64 | * @return mixed |
||
| 65 | */ |
||
| 66 | public function getName() |
||
| 69 | } |
||
| 70 | } |
||
| 71 |