| 1 | <?php |
||
| 11 | trait RelationshipTrait |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * Defines an inverse one-to-one or many relationship. |
||
| 15 | * |
||
| 16 | * @var array |
||
| 17 | */ |
||
| 18 | protected $belongs_to = []; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @var array |
||
| 22 | */ |
||
| 23 | protected $with = []; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Returns "belongs to" relationships. |
||
| 27 | * |
||
| 28 | * @return |
||
| 29 | */ |
||
| 30 | public function getBelongsToRelationships() |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Gets the defined relationships. |
||
| 37 | * |
||
| 38 | * @return |
||
| 39 | */ |
||
| 40 | public function getRelationships() |
||
| 44 | |||
| 45 | /** |
||
| 46 | * Adds a relationship/s to the model. |
||
| 47 | * |
||
| 48 | * @param string|array $relationships |
||
| 49 | * @return self |
||
| 50 | */ |
||
| 51 | public function with($relationships) |
||
| 63 | } |
||
| 64 |