• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP zbx_array_mintersect函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中zbx_array_mintersect函数的典型用法代码示例。如果您正苦于以下问题:PHP zbx_array_mintersect函数的具体用法?PHP zbx_array_mintersect怎么用?PHP zbx_array_mintersect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了zbx_array_mintersect函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: exists

 /**
  * Check if application exists.
  *
  * @deprecated	As of version 2.4, use get method instead.
  *
  * @param array	$object
  *
  * @return bool
  */
 public function exists(array $object)
 {
     $this->deprecated('application.exists method is deprecated.');
     $application = $this->get(array('output' => array('applicationid'), 'filter' => zbx_array_mintersect(array(array('hostid', 'host'), 'name'), $object), 'limit' => 1));
     return (bool) $application;
 }
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:15,代码来源:CApplication.php


示例2: exists

 public function exists($data)
 {
     $keyFields = array(array('screenid', 'name'), 'templateid');
     $options = array('filter' => zbx_array_mintersect($keyFields, $data), 'preservekeys' => true, 'output' => API_OUTPUT_SHORTEN, 'nopermissions' => true, 'limit' => 1);
     if (isset($data['node'])) {
         $options['nodeids'] = getNodeIdByNodeName($data['node']);
     } elseif (isset($data['nodeids'])) {
         $options['nodeids'] = $data['nodeids'];
     }
     $screens = $this->get($options);
     return !empty($screens);
 }
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:12,代码来源:CTemplateScreen.php


示例3: exists

 /**
  * Is interface exist.
  *
  * @param array $object
  *
  * @return bool
  */
 public function exists(array $object)
 {
     $keyFields = array('interfaceid', 'hostid', 'ip', 'dns');
     $options = array('filter' => zbx_array_mintersect($keyFields, $object), 'output' => array('interfaceid'), 'nopermissions' => true, 'limit' => 1);
     if (isset($object['node'])) {
         $options['nodeids'] = getNodeIdByNodeName($object['node']);
     } elseif (isset($object['nodeids'])) {
         $options['nodeids'] = $object['nodeids'];
     }
     $objs = $this->get($options);
     return !empty($objs);
 }
开发者ID:itnihao,项目名称:zatree-2.2,代码行数:19,代码来源:CHostInterface.php


示例4: exists

 /**
  * @param $object
  *
  * @return bool
  */
 public function exists(array $object)
 {
     $keyFields = array(array('hostid', 'host'), 'description');
     $result = false;
     if (!isset($object['hostid']) && !isset($object['host'])) {
         $expressionData = new CTriggerExpression();
         if (!$expressionData->parse($object['expression'])) {
             return false;
         }
         $expressionHosts = $expressionData->getHosts();
         $object['host'] = reset($expressionHosts);
     }
     $options = array('filter' => array_merge(zbx_array_mintersect($keyFields, $object), array('flags' => null)), 'output' => API_OUTPUT_EXTEND, 'nopermissions' => true);
     if (isset($object['node'])) {
         $options['nodeids'] = getNodeIdByNodeName($object['node']);
     } elseif (isset($object['nodeids'])) {
         $options['nodeids'] = $object['nodeids'];
     }
     $triggers = $this->get($options);
     foreach ($triggers as $trigger) {
         $tmpExp = explode_exp($trigger['expression']);
         if (strcmp($tmpExp, $object['expression']) == 0) {
             $result = true;
             break;
         }
     }
     return $result;
 }
开发者ID:itnihao,项目名称:Zabbix_,代码行数:33,代码来源:CTrigger.php


示例5: updateReal

 /**
  * Updates the host prototypes and propagates the changes to linked hosts and templates.
  *
  * @param array $hostPrototypes
  *
  * @return array
  */
 protected function updateReal(array $hostPrototypes)
 {
     // save the host prototypes
     foreach ($hostPrototypes as $hostPrototype) {
         DB::updateByPk($this->tableName(), $hostPrototype['hostid'], $hostPrototype);
     }
     $exHostPrototypes = $this->get(['output' => ['hostid'], 'selectGroupLinks' => API_OUTPUT_EXTEND, 'selectGroupPrototypes' => API_OUTPUT_EXTEND, 'selectTemplates' => ['templateid'], 'selectInventory' => API_OUTPUT_EXTEND, 'hostids' => zbx_objectValues($hostPrototypes, 'hostid'), 'preservekeys' => true]);
     // update related objects
     $inventoryCreate = [];
     $inventoryDeleteIds = [];
     foreach ($hostPrototypes as $key => $hostPrototype) {
         $exHostPrototype = $exHostPrototypes[$hostPrototype['hostid']];
         // group prototypes
         if (isset($hostPrototype['groupPrototypes'])) {
             foreach ($hostPrototype['groupPrototypes'] as &$groupPrototype) {
                 $groupPrototype['hostid'] = $hostPrototype['hostid'];
             }
             unset($groupPrototype);
             // save group prototypes
             $exGroupPrototypes = zbx_toHash(array_merge($exHostPrototype['groupLinks'], $exHostPrototype['groupPrototypes']), 'group_prototypeid');
             $modifiedGroupPrototypes = [];
             foreach ($hostPrototype['groupPrototypes'] as $groupPrototype) {
                 if (isset($groupPrototype['group_prototypeid'])) {
                     unset($exGroupPrototypes[$groupPrototype['group_prototypeid']]);
                 }
                 $modifiedGroupPrototypes[] = $groupPrototype;
             }
             if ($exGroupPrototypes) {
                 $this->deleteGroupPrototypes(array_keys($exGroupPrototypes));
             }
             $hostPrototypes[$key]['groupPrototypes'] = DB::save('group_prototype', $modifiedGroupPrototypes);
         }
         // templates
         if (isset($hostPrototype['templates'])) {
             $existingTemplateIds = zbx_objectValues($exHostPrototype['templates'], 'templateid');
             $newTemplateIds = zbx_objectValues($hostPrototype['templates'], 'templateid');
             $this->unlink(array_diff($existingTemplateIds, $newTemplateIds), [$hostPrototype['hostid']]);
             $this->link(array_diff($newTemplateIds, $existingTemplateIds), [$hostPrototype['hostid']]);
         }
         // inventory
         if (isset($hostPrototype['inventory'])) {
             $inventory = zbx_array_mintersect(['inventory_mode'], $hostPrototype['inventory']);
             $inventory['hostid'] = $hostPrototype['hostid'];
             if ($hostPrototype['inventory'] && (!isset($hostPrototype['inventory']['inventory_mode']) || $hostPrototype['inventory']['inventory_mode'] != HOST_INVENTORY_DISABLED)) {
                 if ($exHostPrototype['inventory']) {
                     DB::update('host_inventory', ['values' => $inventory, 'where' => ['hostid' => $inventory['hostid']]]);
                 } else {
                     $inventoryCreate[] = $inventory;
                 }
             } else {
                 $inventoryDeleteIds[] = $hostPrototype['hostid'];
             }
         }
     }
     // save inventory
     DB::insert('host_inventory', $inventoryCreate, false);
     DB::delete('host_inventory', ['hostid' => $inventoryDeleteIds]);
     // TODO: REMOVE info
     $updatedHostPrototypes = $this->get(['hostids' => zbx_objectValues($hostPrototypes, 'hostid'), 'output' => ['host'], 'selectParentHost' => ['host'], 'nopermissions' => true]);
     foreach ($updatedHostPrototypes as $hostProtototype) {
         info(_s('Updated: Host prototype "%1$s" on "%2$s".', $hostProtototype['host'], $hostProtototype['parentHost']['host']));
     }
     return $hostPrototypes;
 }
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:71,代码来源:CHostPrototype.php


示例6: exists

 public function exists($object)
 {
     $keyFields = array(array('dserviceid'));
     $options = array('filter' => zbx_array_mintersect($keyFields, $object), 'output' => API_OUTPUT_SHORTEN, 'nopermissions' => 1, 'limit' => 1);
     if (isset($object['node'])) {
         $options['nodeids'] = getNodeIdByNodeName($object['node']);
     } elseif (isset($object['nodeids'])) {
         $options['nodeids'] = $object['nodeids'];
     }
     $objs = $this->get($options);
     return !empty($objs);
 }
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:12,代码来源:CDService.php


示例7: exists

 public static function exists($object)
 {
     $keyFields = array(array('hostid', 'host'), 'description');
     $result = false;
     if (!isset($object['hostid']) && !isset($object['host'])) {
         $expr = new CTriggerExpression($object);
         $expression = $object['expression'];
         if (!empty($expr->errors)) {
             return false;
         }
         if (empty($expr->data['hosts'])) {
             return false;
         }
         $object['host'] = reset($expr->data['hosts']);
     }
     $options = array('filter' => zbx_array_mintersect($keyFields, $object), 'output' => API_OUTPUT_EXTEND, 'nopermissions' => 1);
     if (isset($object['node'])) {
         $options['nodeids'] = getNodeIdByNodeName($object['node']);
     } else {
         if (isset($object['nodeids'])) {
             $options['nodeids'] = $object['nodeids'];
         }
     }
     $triggers = self::get($options);
     foreach ($triggers as $tnum => $trigger) {
         $tmp_exp = explode_exp($trigger['expression'], false);
         if (strcmp($tmp_exp, $object['expression']) == 0) {
             $result = true;
             break;
         }
     }
     return $result;
 }
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:33,代码来源:class.ctrigger.php


示例8: exists

 /**
  * Check if host group exists.
  *
  * @deprecated	As of version 2.4, use get method instead.
  *
  * @param array	$object
  *
  * @return bool
  */
 public function exists(array $object)
 {
     $this->deprecated('hostgroup.exists method is deprecated.');
     $hostGroup = $this->get(array('output' => array('groupid'), 'filter' => zbx_array_mintersect(array('name', 'groupid'), $object), 'limit' => 1));
     return (bool) $hostGroup;
 }
开发者ID:unix1986,项目名称:zabbix,代码行数:15,代码来源:CHostGroup.php


示例9: exists

 public static function exists($object)
 {
     $keyFields = array('name', 'groupid');
     $options = array('filter' => zbx_array_mintersect($keyFields, $object), 'output' => API_OUTPUT_SHORTEN, 'nopermissions' => 1, 'limit' => 1);
     if (isset($object['node'])) {
         $options['nodeids'] = getNodeIdByNodeName($object['node']);
     } else {
         if (isset($object['nodeids'])) {
             $options['nodeids'] = $object['nodeids'];
         }
     }
     $objs = self::get($options);
     return !empty($objs);
 }
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:14,代码来源:class.chostgroup.php


示例10: exists

 /**
  * Check if trigger exists.
  *
  * @deprecated	As of version 2.4, use get method instead.
  *
  * @param array $object
  *
  * @return bool
  */
 public function exists(array $object)
 {
     $this->deprecated('trigger.exists method is deprecated.');
     $keyFields = array(array('hostid', 'host'), 'description');
     $result = false;
     if (!isset($object['hostid']) && !isset($object['host'])) {
         $expressionData = new CTriggerExpression();
         if (!$expressionData->parse($object['expression'])) {
             return false;
         }
         $expressionHosts = $expressionData->getHosts();
         $object['host'] = reset($expressionHosts);
     }
     $triggers = $this->get(array('filter' => array_merge(zbx_array_mintersect($keyFields, $object), array('flags' => null)), 'output' => API_OUTPUT_EXTEND));
     foreach ($triggers as $trigger) {
         $tmpExp = explode_exp($trigger['expression']);
         if (strcmp($tmpExp, $object['expression']) == 0) {
             $result = true;
             break;
         }
     }
     return $result;
 }
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:32,代码来源:CTrigger.php


示例11: exists

 /**
  * Check if discovered host exists.
  *
  * @deprecated	As of version 2.4, use get method instead.
  *
  * @param array	$object
  *
  * @return bool
  */
 public function exists(array $object)
 {
     $this->deprecated('dhost.exists method is deprecated.');
     $dHost = $this->get(array('output' => array('dhostid'), 'filter' => zbx_array_mintersect(array(array('dhostid')), $object), 'limit' => 1));
     return (bool) $dHost;
 }
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:15,代码来源:CDHost.php


示例12: exists

 /**
  * Check if template screen exists.
  *
  * @deprecated	As of version 2.4, use get method instead.
  *
  * @param array	$object
  *
  * @return bool
  */
 public function exists(array $object)
 {
     $this->deprecated('templatescreen.exists method is deprecated.');
     $templateScreen = $this->get(array('output' => array('screenid'), 'filter' => zbx_array_mintersect(array(array('screenid', 'name'), 'templateid'), $object), 'preservekeys' => true, 'limit' => 1));
     return (bool) $templateScreen;
 }
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:15,代码来源:CTemplateScreen.php


示例13: exists

 public static function exists($data)
 {
     $keyFields = array(array('screenid', 'name'));
     $options = array('filter' => zbx_array_mintersect($keyFields, $data), 'output' => API_OUTPUT_SHORTEN, 'nopermissions' => 1, 'limit' => 1);
     if (isset($data['node'])) {
         $options['nodeids'] = getNodeIdByNodeName($data['node']);
     } else {
         if (isset($data['nodeids'])) {
             $options['nodeids'] = $data['nodeids'];
         }
     }
     $sysmaps = self::get($options);
     return !empty($sysmaps);
 }
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:14,代码来源:class.cscreen.php


示例14: exists

 /**
  * Check if host interface exists.
  *
  * @deprecated	As of version 2.4, use get method instead.
  *
  * @param array	$object
  *
  * @return bool
  */
 public function exists(array $object)
 {
     $this->deprecated('hostinterface.exists method is deprecated.');
     $hostInterface = $this->get(array('output' => array('interfaceid'), 'filter' => zbx_array_mintersect(array('interfaceid', 'hostid', 'ip', 'dns'), $object), 'limit' => 1));
     return (bool) $hostInterface;
 }
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:15,代码来源:CHostInterface.php


示例15: exists

 /**
  * Check if maintenance exists.
  *
  * @deprecated	As of version 2.4, use get method instead.
  *
  * @param array	$object
  *
  * @return bool
  */
 public function exists(array $object)
 {
     $this->deprecated('maintenance.exists method is deprecated.');
     $keyFields = array(array('maintenanceid', 'name'));
     $maintenance = $this->get(array('output' => array('maintenanceid'), 'filter' => zbx_array_mintersect($keyFields, $object), 'limit' => 1));
     return (bool) $maintenance;
 }
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:16,代码来源:CMaintenance.php


示例16: exists

 /**
  * Check if template exists.
  *
  * @deprecated	As of version 2.4, use get method instead.
  *
  * @param array	$object
  *
  * @return bool
  */
 public function exists(array $object)
 {
     $this->deprecated('template.exists method is deprecated.');
     $template = $this->get(array('output' => array('templateid'), 'filter' => zbx_array_mintersect(array(array('templateid', 'host', 'name')), $object), 'limit' => 1));
     return (bool) $template;
 }
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:15,代码来源:CTemplate.php


示例17: exists

 /**
  * Determine, whether an object already exists
  *
  * @param array $object
  * @return bool
  */
 public function exists(array $object)
 {
     $keyFields = array(array('maintenanceid', 'name'));
     $options = array('filter' => zbx_array_mintersect($keyFields, $object), 'output' => array('maintenanceid'), 'nopermissions' => true, 'limit' => 1);
     $objs = $this->get($options);
     return !empty($objs);
 }
开发者ID:itnihao,项目名称:Zabbix_,代码行数:13,代码来源:CMaintenance.php


示例18: exists

 /**
  * Check if image exists.
  *
  * @deprecated	As of version 2.4, use get method instead.
  *
  * @param array	$object
  *
  * @return bool
  */
 public function exists(array $object)
 {
     $this->deprecated('image.exists method is deprecated.');
     $image = $this->get(array('output' => array('imageid'), 'filter' => zbx_array_mintersect(array(array('imageid', 'name'), 'imagetype'), $object), 'limit' => 1));
     return (bool) $image;
 }
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:15,代码来源:CImage.php


示例19: exists

 /**
  * Check if map exists.
  *
  * @deprecated	As of version 2.4, use get method instead.
  *
  * @param array	$object
  *
  * @return bool
  */
 public function exists(array $object)
 {
     $this->deprecated('map.exists method is deprecated.');
     $map = $this->get(array('output' => array('sysmapid'), 'filter' => zbx_array_mintersect(array(array('sysmapid', 'name')), $object), 'limit' => 1));
     return (bool) $map;
 }
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:15,代码来源:CMap.php


示例20: exists

 /**
  * Determine, whether an object already exists
  *
  * @param array $object
  * @return bool
  */
 public static function exists($object)
 {
     $keyFields = array(array('maintenanceid', 'name'));
     $options = array('filter' => zbx_array_mintersect($keyFields, $object), 'output' => API_OUTPUT_SHORTEN, 'nopermissions' => 1, 'limit' => 1);
     $objs = self::get($options);
     return !empty($objs);
 }
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:13,代码来源:class.cmaintenance.php



注:本文中的zbx_array_mintersect函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP zbx_cleanHashes函数代码示例发布时间:2022-05-23
下一篇:
PHP zbx_array_merge函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap