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


PHP Service类代码示例

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


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

示例1: delete_list

 function delete_list($id)
 {
     if ($id) {
         $rs = new Service($id);
         $rs->delete();
     }
 }
开发者ID:unisexx,项目名称:imac,代码行数:7,代码来源:services.php

示例2: getGroupMembers

 /**
  * Requires memberOf attribute.
  *
  * @static
  * @param $ldapGroup
  * @param $options
  * @return User[]
  */
 public static function getGroupMembers($ldapGroup, $options)
 {
     if ($options instanceof Service) {
         $ldap = $options;
     } else {
         $ldap = new Service($options);
     }
     $filter = "(&(objectCategory=user)(memberOf={$ldapGroup}))";
     $attributes = array('samaccountname', 'cn', 'givenname', 'sn', 'mail', 'title', 'department', 'memberof');
     $results = $ldap->search($filter, $attributes);
     $users = array();
     foreach ($results as $row) {
         $users[] = new User($row);
     }
     // sort by name TODO use $options to change comparison property
     usort($users, function ($a, $b) {
         $al = strtolower($a->getName());
         $bl = strtolower($b->getName());
         if ($al == $bl) {
             return 0;
         }
         return $al > $bl ? +1 : -1;
     });
     return $users;
 }
开发者ID:nesbert,项目名称:nobjects,代码行数:33,代码来源:User.php

示例3: loadRoutesFromService

 /**
  * Loads the routs fromm the api endpoint and stores them locally.
  */
 public function loadRoutesFromService()
 {
     $service = new Service('endpoints');
     $service->routes(array('list' => array('path' => '/api/endpoints', 'method' => 'GET')));
     $this->_routeList = $service->list();
     $this->cacheRoutes();
 }
开发者ID:carriercomm,项目名称:volcano-sdk-php,代码行数:10,代码来源:Router.php

示例4: addService

 private function addService()
 {
     if ($this->requestParameter['submit']) {
         $objService = new Service();
         $objServiceValidator = NCConfigFactory::getInstance()->getServiceValidator();
         $objService->setServiceId($this->requestParameter['serviceId']);
         $objService->setServerId($this->requestParameter['serverId']);
         $objService->setServiceTypeId($this->requestParameter['serviceTypeId']);
         $objService->setServicePort($this->requestParameter['servicePort']);
         $objService->setServiceDNS($this->requestParameter['serviceDNS']);
         $objService->setServiceDNS2($this->requestParameter['serviceDNS2']);
         $objService->setServiceDNS3($this->requestParameter['serviceDNS3']);
         $objService->setServiceRefName($this->requestParameter['serviceRefName']);
         if ($this->requestParameter['serviceId']) {
             $errorArray = $objServiceValidator->editValidation($objService);
             if ($errorArray) {
                 $errorArray['error'] = 'ERROR';
                 echo json_encode($errorArray);
             } else {
                 $this->objServiceManager->editService($objService);
                 echo json_encode(array('serviceId' => $this->requestParameter['serviceId']));
             }
         } else {
             $errorArray = $objServiceValidator->addValidation($objService);
             if ($errorArray) {
                 $errorArray['error'] = 'ERROR';
                 echo json_encode($errorArray);
             } else {
                 $serviceId = $this->objServiceManager->addService($objService);
                 echo json_encode(array('serviceId' => $serviceId));
             }
         }
     }
 }
开发者ID:bindian0509,项目名称:NCConfig,代码行数:34,代码来源:ServiceController.class.php

示例5: Decode

 public function Decode($buf = '')
 {
     $this->buffer = new CodeEngine($buf);
     $this->ResultID = $this->buffer->DecodeInt16();
     $this->Uin = $this->buffer->DecodeInt32();
     if ($this->ResultID == CSResultID::result_id_success) {
         $temp1 = new PlayerCommonInfo();
         $temp1->Decode($this->buffer);
         $this->BaseInfo = $temp1;
         $this->ServiceData->Count = $this->buffer->DecodeInt16();
         for ($i = 0; $i < $this->ServiceData->Count; $i++) {
             $temp2 = new Service();
             $temp2->Decode($this->buffer);
             $this->ServiceData->Service[] = $temp2;
         }
         $this->LockType = $this->buffer->DecodeInt16();
         $this->GameID = $this->buffer->DecodeInt16();
         $this->LockedServerType = $this->buffer->DecodeInt16();
         $this->LockedServerID = $this->buffer->DecodeInt32();
         $this->LockedRoomID = $this->buffer->DecodeInt32();
         $this->LockedTableID = $this->buffer->DecodeInt32();
         $this->LockMoney = $this->buffer->DecodeInt32();
         $this->HappyBeanLockType = $this->buffer->DecodeInt16();
         $this->HappyBeanGameID = $this->buffer->DecodeInt16();
         $this->HappyBeanLockedServerType = $this->buffer->DecodeInt16();
         $this->HappyBeanLockedServerID = $this->buffer->DecodeInt32();
         $this->HappyBeanLockedRoomID = $this->buffer->DecodeInt32();
         $this->HappyBeanLockedTableID = $this->buffer->DecodeInt32();
     }
     return $this;
 }
开发者ID:js-wei,项目名称:Wechat,代码行数:31,代码来源:CResponseGetUserDetailInfo.php

示例6: save

 /**
  * Updates or inserts a contact
  * @param Service $service
  * @return self
  * @throws NotValidException
  */
 public function save(Service $service)
 {
     if (!$this->validate()) {
         throw new NotValidException('Unable to validate contact');
     }
     return $this->reload($service->save($this));
 }
开发者ID:ASDAFF,项目名称:MODX-MoneyBird,代码行数:13,代码来源:Contact.php

示例7: get

 public function get($customerId = null, $carId = null)
 {
     $sql = "SELECT * FROM {$this->tableName} WHERE 1=1";
     if (!empty($customerId)) {
         $sql .= " AND `owner` = " . $this->db->escape($customerId);
     }
     if (!empty($carId)) {
         $sql .= " AND `id` = " . $this->db->escape($carId);
     }
     $result = array();
     $service = new Service();
     if (!empty($carId)) {
         $result = $this->db->fetchOne($sql);
         $customer = new Customer(false);
         $owner = $customer->get($result['owner']);
         if (!empty($owner)) {
             $result['owner'] = $owner;
         }
         $result['services'] = $service->getForCar($carId);
     } else {
         $result = $this->db->fetchAll($sql);
         $customer = new Customer(false);
         foreach ($result as $index => $car) {
             $owner = $customer->get($car['owner']);
             if (!empty($owner)) {
                 $result[$index]['owner'] = $owner;
             }
             $result[$index]['services'] = $service->getForCar($car['id']);
         }
     }
     new Respond($result);
 }
开发者ID:BradlySharpe,项目名称:Sharpies-Auto-Services,代码行数:32,代码来源:Car.php

示例8: __construct

 public function __construct(Service $service)
 {
     $this->db = $db;
     //Выборка всех категорий для меню т.к. используются на всех страницах публичной части
     $this->category = $service->get('category_mapper')->getAll();
     $this->basket_info = Basket::getBasketInfo();
 }
开发者ID:lexdss,项目名称:shop,代码行数:7,代码来源:View.php

示例9: getContact

 /**
  * Get contacts from a given source
  * @param integer $idSource
  * @param integer|bool $page
  * @return bool|Response
  */
 public function getContact($idSource, $page = false)
 {
     if ($page && is_numeric($page)) {
         $page = '?page=' . $page;
     }
     return $this->service->setRequestPath('origin/' . $idSource . '/contact' . $page)->setRequestType(Service::REQUEST_METHOD_GET)->request();
 }
开发者ID:michalper,项目名称:ipresso_api,代码行数:13,代码来源:SourceService.php

示例10: _start

 /**
  * SetUp
  */
 protected function _start()
 {
     $this->table = Doctrine::getTable('OperationNotification');
     // Создать услугу с захардкоженным ID
     $service = new Service();
     $service->setKeyword(Service::SERVICE_SMS);
     $service->save();
 }
开发者ID:ru-easyfinance,项目名称:EasyFinance,代码行数:11,代码来源:OperationNotificationTableTest.php

示例11: change_template

 public function change_template()
 {
     App::import('Model', 'Service');
     $mService = new Service();
     $service = $mService->find('first', array('conditions' => array('Service.id' => $this->request->data['idService'])));
     echo json_encode($service['Service']);
     die;
 }
开发者ID:manorms,项目名称:MyHouse,代码行数:8,代码来源:ExpensesController.php

示例12: testSetAndGetParam

 /**
  * @covers  \Request\Service::setParam
  * @covers  \Request\Service::getParams
  * @depends testCreateService
  */
 public function testSetAndGetParam()
 {
     $testKey = 'testKey';
     $request = new Service();
     $request->setParam($testKey, 'value');
     $params = $request->getParams();
     $this->assertEquals('value', $params[$testKey]);
 }
开发者ID:evgenykireev,项目名称:wp-facebook-import,代码行数:13,代码来源:ServiceTest.php

示例13: testShouldDefineServiceWithSetterInjection

 public function testShouldDefineServiceWithSetterInjection()
 {
     $this->app->set('commonService', function (Container $di) {
         $service = new Service($di->get('component'));
         $service->setFormat('xml');
         return $service;
     });
     $service = $this->app->get('commonService');
     $this->assertEquals('xml', $service->getFormat());
 }
开发者ID:php-lab,项目名称:di,代码行数:10,代码来源:ContainerWithServicesTest.php

示例14: testShouldDefineServiceWithSetterInjection

 public function testShouldDefineServiceWithSetterInjection()
 {
     $this->app->commonService = function (Application $app) {
         $service = new Service($app->component);
         $service->setFormat('xml');
         return $service;
     };
     $service = $this->app->commonService;
     $this->assertEquals('xml', $service->getFormat());
 }
开发者ID:php-lab,项目名称:micro-core,代码行数:10,代码来源:ApplicationTest.php

示例15: createParser

 /**
  * Applies the listeners needed to parse client models.
  *
  * @param Service $api API to create a parser for
  *
  * @return callable
  *
  * @throws \UnexpectedValueException
  */
 public static function createParser(Service $api)
 {
     static $mapping = ['json' => 'Vws\\Api\\Parser\\JsonRpcParser', 'rest-json' => 'Vws\\Api\\Parser\\RestJsonParser'];
     $proto = $api->getProtocol();
     if (isset($mapping[$proto])) {
         return new $mapping[$proto]($api);
     } else {
         throw new \UnexpectedValueException('Unknown protocol: ' . $api->getProtocol());
     }
 }
开发者ID:ossistyle,项目名称:http-client-description,代码行数:19,代码来源:Service.php


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