|
@@ 277-285 (lines=9) @@
|
| 274 |
|
/** |
| 275 |
|
* @inheritdoc |
| 276 |
|
*/ |
| 277 |
|
public function getReversePrimaryKey(string $class, string $name): array |
| 278 |
|
{ |
| 279 |
|
$reverseClass = $this->getReverseModelClass($class, $name); |
| 280 |
|
|
| 281 |
|
$table = $this->getTable($reverseClass); |
| 282 |
|
$key = $this->getPrimaryKey($reverseClass); |
| 283 |
|
|
| 284 |
|
return [$key, $table]; |
| 285 |
|
} |
| 286 |
|
|
| 287 |
|
/** |
| 288 |
|
* @inheritdoc |
|
@@ 290-299 (lines=10) @@
|
| 287 |
|
/** |
| 288 |
|
* @inheritdoc |
| 289 |
|
*/ |
| 290 |
|
public function getReverseForeignKey(string $class, string $name): array |
| 291 |
|
{ |
| 292 |
|
list ($reverseClass, $reverseName) = $this->getReverseRelationship($class, $name); |
| 293 |
|
|
| 294 |
|
$table = $this->getTable($reverseClass); |
| 295 |
|
// would work only if $name is hasMany relationship |
| 296 |
|
$key = $this->getForeignKey($reverseClass, $reverseName); |
| 297 |
|
|
| 298 |
|
return [$key, $table]; |
| 299 |
|
} |
| 300 |
|
|
| 301 |
|
/** |
| 302 |
|
* @inheritdoc |