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


PHP Zend_Server_Method_Definition::getName方法代码示例

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


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

示例1: addMethod

 /**
  * Add method to definition
  *
  * @param  array|Zend_Server_Method_Definition $method
  * @param  null|string $name
  * @return Zend_Server_Definition
  * @throws Zend_Server_Exception if duplicate or invalid method provided
  */
 public function addMethod($method, $name = null)
 {
     if (is_array($method)) {
         $method = new Zend_Server_Method_Definition($method);
     } elseif (!$method instanceof Zend_Server_Method_Definition) {
         throw new Zend_Server_Exception('Invalid method provided');
     }
     if (is_numeric($name)) {
         $name = null;
     }
     if (null !== $name) {
         $method->setName($name);
     } else {
         $name = $method->getName();
     }
     if (null === $name) {
         throw new Zend_Server_Exception('No method name provided');
     }
     if (!$this->_overwriteExistingMethods && array_key_exists($name, $this->_methods)) {
         throw new Zend_Server_Exception(sprintf('Method by name of "%s" already exists', $name));
     }
     $this->_methods[$name] = $method;
     return $this;
 }
开发者ID:NerdGZ,项目名称:icingaweb2,代码行数:32,代码来源:Definition.php

示例2: _addMethodServiceMap

 /**
  * Add service method to service map
  *
  * @param  Zend_Server_Reflection_Function $method
  * @return void
  */
 protected function _addMethodServiceMap(Zend_Server_Method_Definition $method)
 {
     $serviceInfo = array('name' => $method->getName(), 'return' => $this->_getReturnType($method));
     $params = $this->_getParams($method);
     $serviceInfo['params'] = $params;
     $serviceMap = $this->getServiceMap();
     if (false !== $serviceMap->getService($serviceInfo['name'])) {
         $serviceMap->removeService($serviceInfo['name']);
     }
     $serviceMap->addService($serviceInfo);
 }
开发者ID:yonetici,项目名称:pimcore-coreshop-demo,代码行数:17,代码来源:Server.php

示例3: _dispatch

 /**
  * Dispatch method
  *
  * @param  Zend_Server_Method_Definition $invocable
  * @param  array $params
  * @return mixed
  */
 protected function _dispatch(Zend_Server_Method_Definition $invocable, array $params)
 {
     $callback = $invocable->getCallback();
     $type = $callback->getType();
     if ('function' == $type) {
         $function = $callback->getFunction();
         return call_user_func_array($function, $params);
     }
     $class = $callback->getClass();
     $method = $callback->getMethod();
     if ('static' == $type) {
         return call_user_func_array(array($class, $method), $params);
     }
     if (!isset($this->_instances[$invocable->getName()])) {
         $object = $invocable->getObject();
         if (!is_object($object)) {
             $invokeArgs = $invocable->getInvokeArguments();
             if (!empty($invokeArgs)) {
                 $reflection = new ReflectionClass($class);
                 $object = $reflection->newInstanceArgs($invokeArgs);
             } else {
                 $object = new $class();
             }
         }
         $this->_instances[$invocable->getName()] = $object;
     }
     $object = $this->_instances[$invocable->getName()];
     return call_user_func_array(array($object, $method), $params);
 }
开发者ID:roed,项目名称:zend-mvc-extend,代码行数:36,代码来源:Server.php


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