| @@ 255-263 (lines=9) @@ | ||
| 252 | /** |
|
| 253 | * @inheritdoc |
|
| 254 | */ |
|
| 255 | public function getReversePrimaryKey($class, $name) |
|
| 256 | { |
|
| 257 | $reverseClass = $this->getReverseModelClass($class, $name); |
|
| 258 | ||
| 259 | $table = $this->getTable($reverseClass); |
|
| 260 | $key = $this->getPrimaryKey($reverseClass); |
|
| 261 | ||
| 262 | return [$key, $table]; |
|
| 263 | } |
|
| 264 | ||
| 265 | /** |
|
| 266 | * @inheritdoc |
|
| @@ 268-277 (lines=10) @@ | ||
| 265 | /** |
|
| 266 | * @inheritdoc |
|
| 267 | */ |
|
| 268 | public function getReverseForeignKey($class, $name) |
|
| 269 | { |
|
| 270 | list ($reverseClass, $reverseName) = $this->getReverseRelationship($class, $name); |
|
| 271 | ||
| 272 | $table = $this->getTable($reverseClass); |
|
| 273 | // would work only if $name is hasMany relationship |
|
| 274 | $key = $this->getForeignKey($reverseClass, $reverseName); |
|
| 275 | ||
| 276 | return [$key, $table]; |
|
| 277 | } |
|
| 278 | ||
| 279 | /** |
|
| 280 | * @inheritdoc |
|