@@ 306-314 (lines=9) @@ | ||
303 | /** |
|
304 | * @inheritdoc |
|
305 | */ |
|
306 | public function getReversePrimaryKey(string $class, string $name): array |
|
307 | { |
|
308 | $reverseClass = $this->getReverseModelClass($class, $name); |
|
309 | ||
310 | $table = $this->getTable($reverseClass); |
|
311 | $key = $this->getPrimaryKey($reverseClass); |
|
312 | ||
313 | return [$key, $table]; |
|
314 | } |
|
315 | ||
316 | /** |
|
317 | * @inheritdoc |
|
@@ 319-328 (lines=10) @@ | ||
316 | /** |
|
317 | * @inheritdoc |
|
318 | */ |
|
319 | public function getReverseForeignKey(string $class, string $name): array |
|
320 | { |
|
321 | list ($reverseClass, $reverseName) = $this->getReverseRelationship($class, $name); |
|
322 | ||
323 | $table = $this->getTable($reverseClass); |
|
324 | // would work only if $name is hasMany relationship |
|
325 | $key = $this->getForeignKey($reverseClass, $reverseName); |
|
326 | ||
327 | return [$key, $table]; |
|
328 | } |
|
329 | ||
330 | /** |
|
331 | * @inheritdoc |