protected function getWhereClause()
    {
        $where = "WHERE\n";
        
        $value = $this->user_id_getter->invoke();
        
        if (empty($value) && (string)$value != "0") {
            $where .= $this->user_id_field . " IS NULL";
        } else switch (checkempty($this->settings_fields[$this->user_id_field])) {
            case DBWorker::DB_NUMBER:
                $where .= $this->user_id_field . " = " . $value;
                break;
            
            case DBWorker::DB_DATETIME:
                $where .= $this->user_id_field . " = '" . $this->dbworker->format_datetime($value) . "'";
                break;
            
            case DBWorker::DB_DATE:
                $where .= $this->user_id_field . " = '" . $this->dbworker->format_date($value) . "'";
                break;
            
            default:
                $where .= $this->user_id_field . " = '" . $value . "'";
        }
        
        return $where;
    }