当前位置: 首页>>代码示例>>PHP>>正文


PHP WSService::__construct方法代码示例

本文整理汇总了PHP中WSService::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP WSService::__construct方法的具体用法?PHP WSService::__construct怎么用?PHP WSService::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WSService的用法示例。


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

示例1: __construct

 /**
  * @param array $args this should have entries for
  *      "config" and "operations" + other WSService constrctor arguments
  */
 public function __construct($args)
 {
     // validating the user args
     if (!array_key_exists(DS_CONFIG, $args)) {
         DSUtils::error_log(__FILE__, __LINE__, "Configs are missing in the DataService constructor");
     }
     if (!array_key_exists(DS_OPERATIONS, $args)) {
         DSUtils::error_log(__FILE__, __LINE__, "Operations are missing in the DataService constructor");
     }
     // deriving operations for WSService constructor
     $wsservice_operatoins = array();
     // build the operation array for the WSService constructor
     $args_ops = $args[DS_OPERATIONS];
     foreach ($args_ops as $key => $value) {
         $wsservice_operations[$key] = $key;
     }
     // building the WSService construtor arguments
     $wsservice_args = array(DS_CLASSES => array(DS_PROCESSOR_HANDLER => array(DS_OPERATIONS => $wsservice_operations, DS_ARGS => array($args))));
     /* put all the arguments except the operations and config
        as arguments for the WSConstructor */
     foreach ($args as $args_key => $args_value) {
         if ($args_key != DS_OPERATIONS && $args_key != DS_CONFIG) {
             $wsservice_args[$args_key] = $args_value;
         }
     }
     $args_config = $args[DS_CONFIG];
     $wsservice_args[DS_ANNOTATIONS] = $this->generate_annotations($args_ops, $args_config);
     // call the parent constructor
     parent::__construct($wsservice_args);
 }
开发者ID:ztobs,项目名称:wsf,代码行数:34,代码来源:DataService.php


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