protected function applyQueryOutputOptions($tableName, $tableAlias, array $options, array $sqlParts) { $sqlParts = parent::applyQueryOutputOptions($tableName, $tableAlias, $options, $sqlParts); if (!$options['countOutput'] !== null) { // expandData if (!is_null($options['expandData'])) { $sqlParts['select']['host'] = 'h.host'; $sqlParts['select']['hostid'] = 'h.hostid'; $sqlParts['from']['functions'] = 'functions f'; $sqlParts['from']['items'] = 'items i'; $sqlParts['from']['hosts'] = 'hosts h'; $sqlParts['where']['ft'] = 'f.triggerid=t.triggerid'; $sqlParts['where']['fi'] = 'f.itemid=i.itemid'; $sqlParts['where']['hi'] = 'h.hostid=i.hostid'; } } return $sqlParts; }
protected function applyQueryOutputOptions($tableName, $tableAlias, array $options, array $sqlParts) { $sqlParts = parent::applyQueryOutputOptions($tableName, $tableAlias, $options, $sqlParts); if ($options['countOutput'] === null && $options['expandDescription'] !== null) { $sqlParts = $this->addQuerySelect($this->fieldId('expression'), $sqlParts); } return $sqlParts; }
protected function applyQueryOutputOptions($tableName, $tableAlias, array $options, array $sqlParts) { $sqlParts = parent::applyQueryOutputOptions($tableName, $tableAlias, $options, $sqlParts); if ($options['countOutput'] === null) { // expandData if (!is_null($options['expandData'])) { $sqlParts['select']['hostname'] = 'h.name AS hostname'; $sqlParts['select']['host'] = 'h.host'; $sqlParts['select']['hostid'] = 'h.hostid'; $sqlParts['from']['functions'] = 'functions f'; $sqlParts['from']['items'] = 'items i'; $sqlParts['from']['hosts'] = 'hosts h'; $sqlParts['where']['ft'] = 'f.triggerid=t.triggerid'; $sqlParts['where']['fi'] = 'f.itemid=i.itemid'; $sqlParts['where']['hi'] = 'h.hostid=i.hostid'; } if ($options['expandDescription'] !== null) { $sqlParts = $this->addQuerySelect($this->fieldId('expression'), $sqlParts); } // select the state field to be able to return the deprecated value_flag property if ($this->outputIsRequested('value_flag', $options['output'])) { $sqlParts = $this->addQuerySelect($this->fieldId('state'), $sqlParts); } } return $sqlParts; }