protected function getUserId()
    {
        if (property_exists($this, 'userKey'))
        {
            $userKey = $this->userKey;

            return $this->$userKey;
        }

        if ( ! is_null($this->user_id))
        {
            return $this->user_id;
        }

        return null;
    }
protected function getUserId()
    {
        if (property_exists($this, 'userKey'))
        {
            $userKey = $this->userKey;

            return $this->$userKey;
        }

        if ( ! is_null($this->user_id))
        {
            return $this->user_id;
        }

        return null;
    }
protected function getUserId ( ) { if ( property_exists ( $ this , 'userKey' ) ) { $ userKey = $ this -> userKey ; return $ this -> $ userKey ; } if ( ! is_null ( $ this -> user_id ) ) { return $ this -> user_id ; } return null ; }
Returns the user that is associated with the model

@return int|null
Returns the user that is associated with the model