Source
'operator' => ['type' => API_STRING_UTF8, 'in' => implode(',', [TAG_OPERATOR_LIKE, TAG_OPERATOR_EQUAL, TAG_OPERATOR_NOT_LIKE, TAG_OPERATOR_NOT_EQUAL, TAG_OPERATOR_EXISTS, TAG_OPERATOR_NOT_EXISTS]), 'default' => DB::getDefault('sysmaps_element_tag', 'operator')]
<?php
/*
** Copyright (C) 2001-2025 Zabbix SIA
**
** This program is free software: you can redistribute it and/or modify it under the terms of
** the GNU Affero General Public License as published by the Free Software Foundation, version 3.
**
** This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
** without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
** See the GNU Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
**/
/**
* Class containing methods for operations with maps.
*/
class CMap extends CMapElement {
public const ACCESS_RULES = [
'get' => ['min_user_type' => USER_TYPE_ZABBIX_USER],
'create' => ['min_user_type' => USER_TYPE_ZABBIX_USER, 'action' => CRoleHelper::ACTIONS_EDIT_MAPS],
'update' => ['min_user_type' => USER_TYPE_ZABBIX_USER, 'action' => CRoleHelper::ACTIONS_EDIT_MAPS],
'delete' => ['min_user_type' => USER_TYPE_ZABBIX_USER, 'action' => CRoleHelper::ACTIONS_EDIT_MAPS]
];
protected $tableName = 'sysmaps';
protected $tableAlias = 's';
protected $sortColumns = ['name', 'width', 'height'];
private $defOptions = [
'sysmapids' => null,
'userids' => null,
'editable' => false,
'nopermissions' => null,
// filter
'filter' => null,
'search' => null,
'searchByAny' => null,
'startSearch' => false,
'excludeSearch' => false,
'searchWildcardsEnabled' => null,
// output
'output' => API_OUTPUT_EXTEND,
'selectSelements' => null,
'selectShapes' => null,
'selectLines' => null,
'selectLinks' => null,
'selectIconMap' => null,
'selectUrls' => null,
'selectUsers' => null,
'selectUserGroups' => null,
'countOutput' => false,
'expandUrls' => null,
'preservekeys' => false,
'sortfield' => '',
'sortorder' => '',
'limit' => null
];
/**
* Get map data.
*
* @param array $options
* @param array $options['sysmapids'] Map IDs.
* @param bool $options['output'] List of map parameters to return.
* @param array $options['selectSelements'] List of map element properties to return.
* @param array $options['selectShapes'] List of map shape properties to return.
* @param array $options['selectLines'] List of map line properties to return.
* @param array $options['selectLinks'] List of map link properties to return.
* @param array $options['selectIconMap'] List of map icon map properties to return.
* @param array $options['selectUrls'] List of map URL properties to return.
* @param array $options['selectUsers'] List of users that the map is shared with.
* @param array $options['selectUserGroups'] List of user groups that the map is shared with.
* @param bool $options['countOutput'] Return the count of records, instead of actual results.
* @param array $options['userids'] Map owner user IDs.
* @param bool $options['editable'] Return with read-write permission only. Ignored for
* SuperAdmins.
* @param bool $options['nopermissions'] Return requested maps even if user has no permissions to
* them.
* @param array $options['filter'] List of field and exactly matched value pairs by which maps
* need to be filtered.
* @param array $options['search'] List of field-value pairs by which maps need to be searched.
* @param array $options['expandUrls'] Adds global map URLs to the corresponding map elements and
* expands macros in all map element URLs.
* @param bool $options['searchByAny']
* @param bool $options['startSearch']
* @param bool $options['excludeSearch']
* @param bool $options['searchWildcardsEnabled']