public function targetForeignKey($key = null)
    {
        deprecationWarning(
            'BelongToMany::targetForeignKey() is deprecated. ' .
            'Use setTargetForeignKey()/getTargetForeignKey() instead.'
        );
        if ($key !== null) {
            $this->setTargetForeignKey($key);
        }

        return $this->getTargetForeignKey();
    }
public function targetForeignKey($key = null)
    {
        deprecationWarning(
            'BelongToMany::targetForeignKey() is deprecated. ' .
            'Use setTargetForeignKey()/getTargetForeignKey() instead.'
        );
        if ($key !== null) {
            $this->setTargetForeignKey($key);
        }

        return $this->getTargetForeignKey();
    }
public function targetForeignKey ( $ key = null ) { deprecationWarning ( 'BelongToMany::targetForeignKey() is deprecated. ' . 'Use setTargetForeignKey()/getTargetForeignKey() instead.' ) ; if ( $ key !== null ) { $ this -> setTargetForeignKey ( $ key ) ; } return $ this -> getTargetForeignKey ( ) ; }
Sets the name of the field representing the foreign key to the target table.
If no parameters are passed current field is returned

@deprecated 3.4.0 Use setTargetForeignKey()/getTargetForeignKey() instead.
@param string|null $key the key to be used to link both tables together
@return string
Sets the name of the field representing the foreign key to the target table . If no parameters are passed current field is returned