@@ 351-359 (lines=9) @@ | ||
348 | /** |
|
349 | * @inheritdoc |
|
350 | */ |
|
351 | public function getReversePrimaryKey(string $class, string $name): array |
|
352 | { |
|
353 | $reverseClass = $this->getReverseModelClass($class, $name); |
|
354 | ||
355 | $table = $this->getTable($reverseClass); |
|
356 | $key = $this->getPrimaryKey($reverseClass); |
|
357 | ||
358 | return [$key, $table]; |
|
359 | } |
|
360 | ||
361 | /** |
|
362 | * @inheritdoc |
|
@@ 364-373 (lines=10) @@ | ||
361 | /** |
|
362 | * @inheritdoc |
|
363 | */ |
|
364 | public function getReverseForeignKey(string $class, string $name): array |
|
365 | { |
|
366 | list ($reverseClass, $reverseName) = $this->getReverseRelationship($class, $name); |
|
367 | ||
368 | $table = $this->getTable($reverseClass); |
|
369 | // would work only if $name is hasMany relationship |
|
370 | $key = $this->getForeignKey($reverseClass, $reverseName); |
|
371 | ||
372 | return [$key, $table]; |
|
373 | } |
|
374 | ||
375 | /** |
|
376 | * @inheritdoc |