コード例 #1
0
 /**
  * Returns true if the given method is valid.
  *
  * @param string $api
  * @param string $method
  *
  * @return bool
  */
 protected function isValidMethod($api, $method)
 {
     $apiService = $this->serviceFactory->getObject($api);
     // validate the method
     $availableMethods = [];
     foreach (get_class_methods($apiService) as $serviceMethod) {
         // the comparison must be case insensitive
         $availableMethods[strtolower($serviceMethod)] = true;
     }
     return isset($availableMethods[$method]);
 }
コード例 #2
0
 public function __construct(array $objects = array())
 {
     parent::__construct(array_merge(array('api' => 'CApiService', 'action' => 'CAction', 'alert' => 'CAlert', 'apiinfo' => 'CAPIInfo', 'application' => 'CApplication', 'configuration' => 'CConfiguration', 'dcheck' => 'CDCheck', 'dhost' => 'CDHost', 'discoveryrule' => 'CDiscoveryRule', 'drule' => 'CDRule', 'dservice' => 'CDService', 'event' => 'CEvent', 'graph' => 'CGraph', 'graphitem' => 'CGraphItem', 'graphprototype' => 'CGraphPrototype', 'host' => 'CHost', 'hostgroup' => 'CHostGroup', 'hostprototype' => 'CHostPrototype', 'history' => 'CHistory', 'hostinterface' => 'CHostInterface', 'image' => 'CImage', 'iconmap' => 'CIconMap', 'item' => 'CItem', 'itemprototype' => 'CItemPrototype', 'maintenance' => 'CMaintenance', 'map' => 'CMap', 'mediatype' => 'CMediatype', 'proxy' => 'CProxy', 'service' => 'CService', 'screen' => 'CScreen', 'screenitem' => 'CScreenItem', 'script' => 'CScript', 'template' => 'CTemplate', 'templatescreen' => 'CTemplateScreen', 'templatescreenitem' => 'CTemplateScreenItem', 'trigger' => 'CTrigger', 'triggerprototype' => 'CTriggerPrototype', 'user' => 'CUser', 'usergroup' => 'CUserGroup', 'usermacro' => 'CUserMacro', 'usermedia' => 'CUserMedia', 'httptest' => 'CHttpTest'), $objects));
 }
コード例 #3
0
ファイル: API.php プロジェクト: jbfavre/debian-zabbix
 /**
  * Returns the CApiInstance object for the requested API.
  *
  * NOTE: This method must only be called from other CApiService objects.
  *
  * @param string $name
  *
  * @return CApiService
  */
 public static function getApiService($name = null)
 {
     return self::$apiServiceFactory->getObject($name ? $name : 'api');
 }
コード例 #4
0
 public function __construct()
 {
     parent::__construct(['1.0' => new C10ImportConverter(), '2.0' => new C20ImportConverter()]);
 }