| @@ 61-63 (lines=3) @@ | ||
| 58 | $table = $row->getTable(); |
|
| 59 | $scheme = $this->table->getScheme(); |
|
| 60 | ||
| 61 | if (!isset($scheme['relations'][$table->name])) { |
|
| 62 | throw new SimpleCrudException(sprintf('The tables %s and %s are no related', $table->name, $this->table->name)); |
|
| 63 | } |
|
| 64 | ||
| 65 | $relation = $scheme['relations'][$table->name]; |
|
| 66 | ||
| @@ 135-137 (lines=3) @@ | ||
| 132 | { |
|
| 133 | $scheme = $this->table->getScheme(); |
|
| 134 | ||
| 135 | if (!isset($scheme['relations'][$table])) { |
|
| 136 | throw new SimpleCrudException(sprintf("The tables '%s' and '%s' are not related", $this->table->name, $table)); |
|
| 137 | } |
|
| 138 | ||
| 139 | if ($scheme['relations'][$table][0] !== Scheme::HAS_ONE) { |
|
| 140 | throw new SimpleCrudException(sprintf("Invalid LEFT JOIN between the tables '%s' and '%s'", $this->table->name, $table)); |
|
| @@ 139-141 (lines=3) @@ | ||
| 136 | throw new SimpleCrudException(sprintf("The tables '%s' and '%s' are not related", $this->table->name, $table)); |
|
| 137 | } |
|
| 138 | ||
| 139 | if ($scheme['relations'][$table][0] !== Scheme::HAS_ONE) { |
|
| 140 | throw new SimpleCrudException(sprintf("Invalid LEFT JOIN between the tables '%s' and '%s'", $this->table->name, $table)); |
|
| 141 | } |
|
| 142 | ||
| 143 | $this->leftJoin[] = [ |
|
| 144 | 'table' => $table, |
|
| @@ 215-217 (lines=3) @@ | ||
| 212 | $relationTable = $row->getTable(); |
|
| 213 | $relations = $table->getScheme()['relations']; |
|
| 214 | ||
| 215 | if (!isset($relations[$relationTable->name])) { |
|
| 216 | throw new SimpleCrudException(sprintf('Invalid relation: %s - %s', $table->name, $relationTable->name)); |
|
| 217 | } |
|
| 218 | ||
| 219 | $relation = $relations[$relationTable->name]; |
|
| 220 | ||