'selectTemplates' => ['type' => API_OUTPUT, 'flags' => API_ALLOW_NULL | API_ALLOW_COUNT, 'in' => implode(',', $template_fields), 'default' => null],
class CTemplateGroup extends CApiService {
public const ACCESS_RULES = [
'get' => ['min_user_type' => USER_TYPE_ZABBIX_USER],
'create' => ['min_user_type' => USER_TYPE_SUPER_ADMIN],
'update' => ['min_user_type' => USER_TYPE_ZABBIX_ADMIN],
'delete' => ['min_user_type' => USER_TYPE_ZABBIX_ADMIN],
'massadd' => ['min_user_type' => USER_TYPE_ZABBIX_ADMIN],
'massupdate' => ['min_user_type' => USER_TYPE_ZABBIX_ADMIN],
'massremove' => ['min_user_type' => USER_TYPE_ZABBIX_ADMIN],
'propagate' => ['min_user_type' => USER_TYPE_SUPER_ADMIN]
protected $tableName = 'hstgrp';
protected $tableAlias = 'g';
protected $sortColumns = ['groupid', 'name'];
public function get(array $options) {
$output_fields = ['groupid', 'name', 'uuid'];
$template_fields = ['templateid', 'host', 'name', 'description', 'uuid'];
$api_input_rules = ['type' => API_OBJECT, 'fields' => [
'groupids' => ['type' => API_IDS, 'flags' => API_ALLOW_NULL | API_NORMALIZE, 'default' => null],
'templateids' => ['type' => API_IDS, 'flags' => API_ALLOW_NULL | API_NORMALIZE, 'default' => null],
'graphids' => ['type' => API_IDS, 'flags' => API_ALLOW_NULL | API_NORMALIZE, 'default' => null],
'triggerids' => ['type' => API_IDS, 'flags' => API_ALLOW_NULL | API_NORMALIZE, 'default' => null],
'with_templates' => ['type' => API_BOOLEAN, 'default' => false],
'with_items' => ['type' => API_BOOLEAN, 'default' => false],
'with_item_prototypes' => ['type' => API_BOOLEAN, 'default' => false],
'with_simple_graph_items' => ['type' => API_BOOLEAN, 'default' => false],
'with_simple_graph_item_prototypes' => ['type' => API_BOOLEAN, 'default' => false],
'with_triggers' => ['type' => API_BOOLEAN, 'default' => false],
'with_httptests' => ['type' => API_BOOLEAN, 'default' => false],
'with_graphs' => ['type' => API_BOOLEAN, 'default' => false],