public function getRelationKey() { if ($this->translationForeignKey) { $key = $this->translationForeignKey; } elseif ($this->primaryKey !== 'id') { $key = $this->primaryKey; } else { $key = $this->getForeignKey(); } return $key; }