Sprig_Core::fk PHP Method

fk() public method

Returns the foreign key of the model, optionally with a table name.
public fk ( $table = NULL ) : string
return string
    public function fk($table = NULL)
    {
        $key = $this->_model . '_' . $this->_primary_key;
        if ($table) {
            if ($table === TRUE) {
                $table = $this->_table;
            }
            return $table . '.' . $key;
        }
        return $key;
    }