1 | <?php |
||
25 | trait RowRelations |
||
26 | { |
||
27 | /** |
||
28 | * @var array relations rows |
||
29 | */ |
||
30 | protected $relations = []; |
||
31 | |||
32 | /** |
||
33 | * Set relation |
||
34 | * |
||
35 | * @param Row $row |
||
36 | * |
||
37 | * @return void |
||
38 | * @throws TableNotFoundException |
||
39 | */ |
||
40 | public function setRelation(Row $row) : void |
||
45 | |||
46 | /** |
||
47 | * Get relation by model name |
||
48 | * |
||
49 | * @param string $modelName |
||
50 | * |
||
51 | * @return RowInterface |
||
52 | * @throws RelationNotFoundException |
||
53 | * @throws TableNotFoundException |
||
54 | */ |
||
55 | 1 | public function getRelation($modelName) : ?RowInterface |
|
60 | |||
61 | /** |
||
62 | * Get relations by model name |
||
63 | * |
||
64 | * @param string $modelName |
||
65 | * |
||
66 | * @return RowInterface[] |
||
67 | * @throws RelationNotFoundException |
||
68 | * @throws TableNotFoundException |
||
69 | */ |
||
70 | 1 | public function getRelations($modelName) : array |
|
78 | } |
||
79 |