public function getForeignKeyValuePair($related)
    {
        $foreignKey = $this->getForeignKey();

        if ($related) {
            $wrapper = $this->factory->make($related);

            $relatedKey = $this->relatedMap->getKeyName();

            return [
                $foreignKey      => $wrapper->getEntityAttribute($relatedKey),
                $this->morphType => $wrapper->getMap()->getMorphClass(),
            ];
        } else {
            return [$foreignKey => null];
        }
    }
public function getForeignKeyValuePair($related)
    {
        $foreignKey = $this->getForeignKey();

        if ($related) {
            $wrapper = $this->factory->make($related);

            $relatedKey = $this->relatedMap->getKeyName();

            return [
                $foreignKey      => $wrapper->getEntityAttribute($relatedKey),
                $this->morphType => $wrapper->getMap()->getMorphClass(),
            ];
        } else {
            return [$foreignKey => null];
        }
    }
public function getForeignKeyValuePair ( $ related ) { $ foreignKey = $ this -> getForeignKey ( ) ; if ( $ related ) { $ wrapper = $ this -> factory -> make ( $ related ) ; $ relatedKey = $ this -> relatedMap -> getKeyName ( ) ; return [ $ foreignKey => $ wrapper -> getEntityAttribute ( $ relatedKey ) , $ this -> morphType => $ wrapper -> getMap ( ) -> getMorphClass ( ) , ] ; } else { return [ $ foreignKey => null ] ; } }
Get the foreign key value pair for a related object.

@param mixed $related

@return array
Get the foreign key value pair for a related object .