protected function getKeyNameFromResource()
    {
        $resource = $this->getForeignResource();

        if (!is_null($resource) && (($field = $resource->getPrimaryField()) != null)) {
            return $field->name;
        }

        return null;
    }
protected function getKeyNameFromResource()
    {
        $resource = $this->getForeignResource();

        if (!is_null($resource) && (($field = $resource->getPrimaryField()) != null)) {
            return $field->name;
        }

        return null;
    }
protected function getKeyNameFromResource ( ) { $ resource = $ this -> getForeignResource ( ) ; if ( ! is_null ( $ resource ) && ( ( $ field = $ resource -> getPrimaryField ( ) ) != null ) ) { return $ field -> name ; } return null ; }
Gets the foreign model columns from the resource file if one exists

@return null | string
Gets the foreign model columns from the resource file if one exists