Illuminate\Database\Eloquent\Relations\BelongsTo::getQualifiedOtherKeyName PHP Method

getQualifiedOtherKeyName() public method

Get the fully qualified associated key of the relationship.
public getQualifiedOtherKeyName ( ) : string
return string
    public function getQualifiedOtherKeyName()
    {
        return $this->related->getTable() . '.' . $this->otherKey;
    }

Usage Example

コード例 #1
2
 protected function joinBelongsToRelation(Relations\BelongsTo $relation, $type)
 {
     $table = $relation->getRelated()->getTable();
     $foreignKey = $relation->getQualifiedForeignKey();
     $localKey = $relation->getQualifiedOtherKeyName();
     $this->query->join($table, $foreignKey, '=', $localKey, $type);
 }
All Usage Examples Of Illuminate\Database\Eloquent\Relations\BelongsTo::getQualifiedOtherKeyName