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


PHP Service::getId方法代码示例

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


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

示例1: getEntitlementsForPrincipalToService

 public function getEntitlementsForPrincipalToService(Principal $p, Service $s)
 {
     $user = sfContext::getInstance()->getUser();
     $eids = array();
     $rps = Doctrine::getTable('RolePrincipal')->findByPrincipalId($p->getId());
     foreach ($rps as $rp) {
         $res = Doctrine::getTable('RoleEntitlement')->findByRoleId($rp->getRoleId());
         foreach ($res as $re) {
             $eids[] = $re->getEntitlementId();
         }
     }
     $ueids = array_unique($eids);
     foreach ($ueids as $ueid) {
         $e = Doctrine::getTable('Entitlement')->find($ueid);
         // $tmp .= $e->getName()." ".$e->getService()." ".$s->getName()."<br>";
         if ($s->isValidated()) {
             if ($e->getServiceId() == $s->getId()) {
                 $es[] = $e;
             }
         }
     }
     if (isset($es)) {
         return $es;
     } else {
         //var_dump(array($tmp));exit;
         return NULL;
     }
 }
开发者ID:br00k,项目名称:yavom,代码行数:28,代码来源:AttributeResolver.class.php

示例2: testInit

 /**
  * Тест /robokassa/init
  *
  */
 public function testInit()
 {
     $user = $this->helper->makeUser();
     //$user->setUserName('Admin');
     $this->authenticateUser($user);
     $user->save();
     $service = new Service();
     $service->price = 100;
     $service->save();
     // Верный запрос
     // Ожидаем редирект
     $this->browser->post($this->generateUrl('robokassa', array('action' => 'init')), array('service' => $service->getId(), 'term' => 6))->with('request')->begin()->isParameter('service', $service->getId())->isParameter('term', 6)->end()->with('response')->begin()->isStatusCode(200)->matches('/(robokassa)/i')->end();
     // Неверный запрос с несуществующим id сервиса
     // Ожидаем переброс на 404
     $this->browser->post('robokassa/init/', array('service' => time(), 'term' => 6))->with('response')->begin()->isStatusCode(404)->end();
 }
开发者ID:ru-easyfinance,项目名称:EasyFinance,代码行数:20,代码来源:robokassaActionsTest.php

示例3: testCascade

 /**
  * Тест каскадных удалений
  *
  */
 public function testCascade()
 {
     $bt = new BillingTransaction();
     // Создаем пользователя, услугу и транзакцию
     $user = $this->helper->makeUser();
     $user->save();
     $service = new Service();
     $service->save();
     $bt->setUserId($user->getId());
     $bt->setServiceId($service->getId());
     $bt->save();
     // При удалении службы транзакция остается
     $service->delete();
     $findBt = Doctrine::getTable('BillingTransaction')->find($bt->getId());
     $this->assertType('BillingTransaction', $findBt);
     $this->assertEquals($findBt->getId(), $bt->getId());
     // При удалении пользователя удаляется запись о транзакции
     $user->delete();
     $findBt = Doctrine::getTable('BillingTransaction')->find($bt->getId());
     $this->assertEquals($findBt, null);
 }
开发者ID:ru-easyfinance,项目名称:EasyFinance,代码行数:25,代码来源:BillingTransactionTest.php

示例4: moveService

 public function moveService(\Service $Service, \Site $Site, \User $user = null)
 {
     //Throws exception if user is not an administrator
     $this->checkUserIsAdmin($user);
     $this->em->getConnection()->beginTransaction();
     //suspend auto-commit
     try {
         //If the site or service have no ID - throw logic exception
         $site_id = $Site->getId();
         if (empty($site_id)) {
             throw new LogicException('Site has no ID');
         }
         $Service_id = $Service->getId();
         if (empty($Service_id)) {
             throw new LogicException('Service has no ID');
         }
         //find old site
         $old_Site = $Service->getParentSite();
         //If the Site has changed, then we move the site.
         if ($old_Site != $Site) {
             //Remove the service from the old site if it has an old site
             if (!empty($old_Site)) {
                 $old_Site->getServices()->removeElement($Service);
             }
             //Add Service to new Site
             $Site->addServiceDoJoin($Service);
             //persist
             $this->em->merge($Site);
             $this->em->merge($old_Site);
         }
         //close if
         $this->em->flush();
         $this->em->getConnection()->commit();
     } catch (Exception $e) {
         $this->em->getConnection()->rollback();
         $this->em->close();
         throw $e;
     }
 }
开发者ID:Tom-Byrne,项目名称:gocdb,代码行数:39,代码来源:ServiceService.php

示例5: addService

 public function addService(Service $service)
 {
     $this->services[$service->getId()] = $service;
 }
开发者ID:Alban-io,项目名称:TheliaStudio,代码行数:4,代码来源:Config.php


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