本文整理汇总了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;
}
示例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());
}
示例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)) {
//.........这里部分代码省略.........
示例4: addResource
/**
* Add a resource
*
* @param self $resource
*/
public function addResource(Resource $resource)
{
$this->subResources[$resource->getUri()] = $resource;
}
示例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;
}
示例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;
}