function getSystemSQL($table = '') { if (!$this->isValid()) { return null; } $userId = SJB_UserManager::getUserIdByKeywords($this->value); $userCriteria = ''; if ($userId && $table == 'listings') { $userCriteria = " OR `listings`.`user_sid` = " . $userId; } $id = SJB_DB::quote($this->property_name); if ($table) { $table = "`{$table}`.`{$id}`"; } $val = SJB_BooleanEvaluator::parse($this->value, false, $table); if ($val === null) { $val = ''; } return "({$val} {$userCriteria})"; }