| 1 | <?php namespace Mascame\Artificer\Fields; |
||
| 3 | trait Relationable |
||
| 4 | { |
||
| 5 | private $relationOptions = null; |
||
| 6 | |||
| 7 | public function getMethod() |
||
| 11 | |||
| 12 | public function getRelatedModel() |
||
| 24 | |||
| 25 | public function getType() |
||
| 35 | |||
| 36 | public function getForeignKey() |
||
| 40 | |||
| 41 | public function getShow() |
||
| 45 | |||
| 46 | private function getRelationOptions() { |
||
| 51 | |||
| 52 | /** |
||
| 53 | * @param string $attribute |
||
| 54 | */ |
||
| 55 | public function getRelationAttribute($attribute) |
||
| 61 | } |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: