public function foreignKey($key = null)
    {
        deprecationWarning(
            get_called_class() . '::foreignKey() is deprecated. ' .
            'Use setForeignKey()/getForeignKey() instead.'
        );
        if ($key !== null) {
            $this->setForeignKey($key);
        }

        return $this->getForeignKey();
    }
public function foreignKey($key = null)
    {
        deprecationWarning(
            get_called_class() . '::foreignKey() is deprecated. ' .
            'Use setForeignKey()/getForeignKey() instead.'
        );
        if ($key !== null) {
            $this->setForeignKey($key);
        }

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

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