當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Resource::getUri方法代碼示例

本文整理匯總了PHP中Resource::getUri方法的典型用法代碼示例。如果您正苦於以下問題:PHP Resource::getUri方法的具體用法?PHP Resource::getUri怎麽用?PHP Resource::getUri使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Resource的用法示例。


在下文中一共展示了Resource::getUri方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: isProcessClass

 /**
  * Short description of method isProcessClass
  *
  * @access public
  * @author Joel Bout, <joel.bout@tudor.lu>
  * @param  Class clazz
  * @return boolean
  */
 public function isProcessClass(core_kernel_classes_Class $clazz)
 {
     $returnValue = (bool) false;
     if ($clazz->getUri() == $this->processClass->getUri()) {
         $returnValue = true;
     } else {
         foreach ($this->processClass->getSubClasses() as $subclass) {
             if ($clazz->getUri() == $subclass->getUri()) {
                 $returnValue = true;
                 break;
             }
         }
     }
     return (bool) $returnValue;
 }
開發者ID:oat-sa,項目名稱:extension-tao-wfauthoring,代碼行數:23,代碼來源:class.wfAuthoringService.php

示例2: testResourceSetUriManual

 /**
  * Test the setting of the resource URI manually
  */
 public function testResourceSetUriManual()
 {
     $uri = '/test';
     $_SERVER['REQUEST_METHOD'] = 'GET';
     $resource = new Resource($uri);
     $this->assertEquals($uri, $resource->getUri());
 }
開發者ID:psecio,項目名稱:invoke,代碼行數:10,代碼來源:ResourceTest.php

示例3: connectorNode

 /**
  * Short description of method connectorNode
  *
  * @access public
  * @author Joel Bout, <joel.bout@tudor.lu>
  * @param  Resource connector
  * @param  string nodeClass
  * @param  boolean recursive
  * @return array
  */
 public function connectorNode(core_kernel_classes_Resource $connector, $nodeClass = '', $recursive = false)
 {
     $returnValue = array();
     $connectorData = array();
     $connectorService = wfEngine_models_classes_ConnectorService::singleton();
     //		$activityService = wfEngine_models_classes_ActivityService::singleton();
     //type of connector:
     //if not null, get the information on the next activities. Otherwise, return an "empty" connector node, indicating that the node has just been created, i.e. at the same time as an activity
     $connectorType = $connector->getOnePropertyValue(new core_kernel_classes_Property(PROPERTY_CONNECTORS_TYPE), false);
     if (is_null($connectorType)) {
         //create default connector node:
         $returnValue = $this->addNodePrefix($this->defaultConnectorNode($connector), $nodeClass);
         return $returnValue;
     } else {
         //if it is a conditional type
         if ($connectorType->getUri() == INSTANCE_TYPEOFCONNECTORS_CONDITIONAL) {
             //get the rule
             $connectorRule = $connector->getOnePropertyValue(new core_kernel_classes_Property(PROPERTY_CONNECTORS_TRANSITIONRULE), false);
             if (!is_null($connectorRule)) {
                 //continue getting connector data:
                 $connectorData[] = $this->conditionNode($connectorRule);
                 //get the "THEN"
                 $then = $connectorRule->getOnePropertyValue(new core_kernel_classes_Property(PROPERTY_TRANSITIONRULES_THEN), false);
                 if (!is_null($then)) {
                     $portData = array('id' => 0, 'label' => 'then', 'multiplicity' => 1);
                     if ($connectorService->isConnector($then)) {
                         $connectorActivityReference = $then->getUniquePropertyValue(new core_kernel_classes_Property(PROPERTY_CONNECTORS_ACTIVITYREFERENCE))->getUri();
                         if ($connectorActivityReference == $this->currentActivity->getUri() && !in_array($then->getUri(), $this->addedConnectors)) {
                             if ($recursive) {
                                 $connectorData[] = $this->connectorNode($then, 'then', true, $portData);
                             } else {
                                 $connectorData[] = $this->activityNode($then, 'then', false, $portData);
                             }
                         } else {
                             $connectorData[] = $this->activityNode($then, 'then', true, $portData);
                         }
                     } else {
                         $connectorData[] = $this->activityNode($then, 'then', true, $portData);
                     }
                 }
                 //same for the "ELSE"
                 $else = $connectorRule->getOnePropertyValue(new core_kernel_classes_Property(PROPERTY_TRANSITIONRULES_ELSE), false);
                 if (!is_null($else)) {
                     $portData = array('id' => 1, 'label' => 'else', 'multiplicity' => 1);
                     if ($connectorService->isConnector($else)) {
                         $connectorActivityReference = $else->getUniquePropertyValue(new core_kernel_classes_Property(PROPERTY_CONNECTORS_ACTIVITYREFERENCE))->getUri();
                         if ($connectorActivityReference == $this->currentActivity->getUri() && !in_array($else->getUri(), $this->addedConnectors)) {
                             if ($recursive) {
                                 $connectorData[] = $this->connectorNode($else, 'else', true, $portData);
                             } else {
                                 $connectorData[] = $this->activityNode($else, 'else', false, $portData);
                             }
                         } else {
                             $connectorData[] = $this->activityNode($else, 'else', true, $portData);
                         }
                     } else {
                         $connectorData[] = $this->activityNode($else, 'else', true, $portData);
                     }
                 }
             }
         } elseif ($connectorType->getUri() == INSTANCE_TYPEOFCONNECTORS_SEQUENCE) {
             $next = $connector->getOnePropertyValue(new core_kernel_classes_Property(PROPERTY_STEP_NEXT), false);
             if (!is_null($next)) {
                 $connectorData[] = $this->activityNode($next, 'next', true);
                 //the default portData array will do
             }
         } elseif ($connectorType->getUri() == INSTANCE_TYPEOFCONNECTORS_PARALLEL) {
             $cardinalityService = wfEngine_models_classes_ActivityCardinalityService::singleton();
             $variableService = wfEngine_models_classes_VariableService::singleton();
             $nextActivitiesCollection = $connector->getPropertyValuesCollection(new core_kernel_classes_Property(PROPERTY_STEP_NEXT));
             $portId = 0;
             foreach ($nextActivitiesCollection->getIterator() as $nextActivity) {
                 if ($cardinalityService->isCardinality($nextActivity)) {
                     $activity = $cardinalityService->getDestination($nextActivity);
                     $cardinality = $cardinalityService->getCardinality($nextActivity);
                     $number = $cardinality instanceof core_kernel_classes_Resource ? '^' . $variableService->getCode($cardinality) : $cardinality;
                     $connectorData[] = $this->activityNode($activity, 'next', true, array('id' => $portId, 'multiplicity' => $number, 'label' => $activity->getLabel()), "(count : {$number})");
                     $portId++;
                 }
             }
         } elseif ($connectorType->getUri() == INSTANCE_TYPEOFCONNECTORS_JOIN) {
             $next = $connector->getOnePropertyValue(new core_kernel_classes_Property(PROPERTY_STEP_NEXT), false);
             if (!is_null($next)) {
                 $connectorData[] = $this->activityNode($next, 'next', true);
                 //the default portData array will do
             }
         } else {
             throw new Exception("unknown connector type: {$connectorType->getLabel()} for connector {$connector->getUri()}");
         }
         if (empty($portInfo)) {
//.........這裏部分代碼省略.........
開發者ID:oat-sa,項目名稱:extension-tao-wfauthoring,代碼行數:101,代碼來源:class.ProcessTreeService.php

示例4: addResource

 /**
  * Add a resource
  *
  * @param self $resource
  */
 public function addResource(Resource $resource)
 {
     $this->subResources[$resource->getUri()] = $resource;
 }
開發者ID:cnam,項目名稱:php-raml-parser,代碼行數:9,代碼來源:Resource.php

示例5: renderLink

 protected function renderLink($rel, Resource $link)
 {
     $xml = '<link';
     $xml .= ' rel="' . $rel . '"';
     $xml .= ' href="' . $link->getUri() . '"';
     if ($link->isTemplated()) {
         $xml .= ' templated="true"';
     }
     $xml .= ' />';
     return $xml;
 }
開發者ID:javigomez,項目名稱:webservices-experiment,代碼行數:11,代碼來源:halxml.php

示例6: getDefaultFilePath

 /**
  * Short description of method getDefaultFilePath
  *
  * @access public
  * @author Somsack Sipasseuth, <somsack.sipasseuth@tudor.lu>
  * @return string
  */
 public function getDefaultFilePath()
 {
     $returnValue = (string) '';
     $returnValue = tao_helpers_Uri::getUniqueId($this->ownerInstance->getUri()) . '/' . tao_helpers_Uri::getUniqueId($this->property->getUri());
     return (string) $returnValue;
 }
開發者ID:swapnilaptara,項目名稱:tao-aptara-assess,代碼行數:13,代碼來源:class.VersionedFile.php


注:本文中的Resource::getUri方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。