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

PHP Service类代码示例

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

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



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


示例16: __construct

 /**
  * A Collection is an array of objects
  *
  * Some assumptions:
  * * The `Collection` class assumes that there exists on its service
  *   a factory method with the same name of the class. For example, if
  *   you create a Collection of class `Foobar`, it will attempt to call
  *   the method `parent::Foobar()` to create instances of that class.
  * * It assumes that the factory method can take an array of values, and
  *   it passes that to the method.
  *
  * @param Service $service - the service associated with the collection
  * @param string $itemclass - the Class of each item in the collection
  *      (assumed to be the name of the factory method)
  * @param array $arr - the input array
  */
 public function __construct($service, $class, array $array = array())
 {
     $service->getLogger()->deprecated(__METHOD__, 'OpenCloud\\Common\\Collection\\CollectionBuilder');
     $this->setService($service);
     $this->setNextPageClass($class);
     // If they've supplied a FQCN, only get the last part
     $class = false !== ($classNamePos = strrpos($class, '\\')) ? substr($class, $classNamePos + 1) : $class;
     $this->setItemClass($class);
     // Set data
     $this->setItemList($array);
 }
开发者ID:fandikurnia,项目名称:CiiMS,代码行数:27,代码来源:Collection.php


示例17: widget

 /**
  * Main process of widget
  * 
  * @param array $args
  * @param array $instance
  */
 public function widget($metric, $url = null)
 {
     $username = Engine_Api::_()->getApi('settings', 'core')->getSetting('ynblog.username');
     $password = Engine_Api::_()->getApi('settings', 'core')->getSetting('ynblog.password');
     $dimension = 'url';
     $oRequest = new Request(new Authentication($username, $password), new Metric($metric), new Dimension($dimension), Ynblog_Api_Addthis::getServiceQuery());
     $oService = new Service($oRequest);
     $response = $oService->getData();
     echo Ynblog_Api_Addthis::getContent($response, $url);
     return Ynblog_Api_Addthis::getContent($response, $url);
 }
开发者ID:hoalangoc,项目名称:ftf,代码行数:17,代码来源:Addthis.php


示例18: get

 /**
  * Parse the service into array
  *
  * @param Service
  * @return array
  */
 public function get(Service $service)
 {
     $result = array();
     $lines = $service->getResult();
     foreach ($lines as $index => $line) {
         if (strpos($line, self::IDENTIFIER) !== false) {
             $result[] = $this->parse($lines, $index);
         }
     }
     return $result;
 }
开发者ID:phpindonesia,项目名称:pintu,代码行数:17,代码来源:ReaderArray.php


示例19: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::table('cs_service_types')->delete();
     $services = array("Theme", "Project", "Fix Bug");
     foreach ($services as $service) {
         $sv = new Service();
         $sv->name = $service;
         $sv->description = "Lorem Ipsum has been the industry's standard dummy text ever since the 1500s";
         $sv->save();
     }
 }
开发者ID:vnzacky,项目名称:exp_services,代码行数:16,代码来源:ServiceTypeSeeder.php


示例20: testIndex

 /**
  * Тест /services/index
  *
  */
 public function testIndex()
 {
     $user = $this->helper->makeUser();
     $this->authenticateUser($user);
     $user->save();
     $service = new Service();
     $service->price = 100;
     $service->name = "Уникальное имя услуги " . uniqid();
     $service->save();
     $this->browser->get($this->generateUrl('services'))->with('response')->begin()->isStatusCode(200)->matches('/(' . $service->name . ')/i')->end();
 }
开发者ID:ru-easyfinance,项目名称:EasyFinance,代码行数:15,代码来源:servicesActionsTest.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP ServiceFactory类代码示例发布时间:2022-05-23
下一篇:
PHP Server类代码示例发布时间: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