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


PHP core_kernel_classes_Resource::getPropertyValuesCollection方法代码示例

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


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

示例1: createActivity

 /**
  * Short description of method createActivity
  *
  * @access public
  * @author Joel Bout, <joel.bout@tudor.lu>
  * @param  Resource process
  * @param  string label
  * @return core_kernel_classes_Resource
  */
 public function createActivity(core_kernel_classes_Resource $process, $label = '')
 {
     $returnValue = null;
     $activityLabel = "";
     $number = 0;
     if (empty($label)) {
         $number = $process->getPropertyValuesCollection(new core_kernel_classes_Property(PROPERTY_PROCESS_ACTIVITIES))->count();
         $number += 1;
         $activityLabel = "Activity_{$number}";
     } else {
         $activityLabel = $label;
     }
     $activityClass = new core_kernel_classes_Class(CLASS_ACTIVITIES);
     $activity = $activityClass->createInstance($activityLabel, "created by ActivityService.Class");
     if (!empty($activity)) {
         //associate the new instance to the process instance
         $process->setPropertyValue(new core_kernel_classes_Property(PROPERTY_PROCESS_ACTIVITIES), $activity->getUri());
         //set if it is the first or not:
         if ($number == 1) {
             $activity->editPropertyValues(new core_kernel_classes_Property(PROPERTY_ACTIVITIES_ISINITIAL), GENERIS_TRUE);
         } else {
             $activity->editPropertyValues(new core_kernel_classes_Property(PROPERTY_ACTIVITIES_ISINITIAL), GENERIS_FALSE);
         }
         //by default, set the 'isHidden' property value to false:
         $activity->editPropertyValues(new core_kernel_classes_Property(PROPERTY_ACTIVITIES_ISHIDDEN), GENERIS_FALSE);
         //by default we add the back and forward controls to the activity
         $activity->editPropertyValues(new core_kernel_classes_Property(PROPERTY_ACTIVITIES_CONTROLS), array(INSTANCE_CONTROL_BACKWARD, INSTANCE_CONTROL_FORWARD));
         $returnValue = $activity;
     } else {
         throw new Exception("the activity cannot be created for the process {$process->getUri()}");
     }
     return $returnValue;
 }
开发者ID:oat-sa,项目名称:extension-tao-wfauthoring,代码行数:42,代码来源:class.ActivityService.php

示例2: getItem

 private function getItem(core_kernel_classes_Resource $service)
 {
     $inParameterCollection = $service->getPropertyValuesCollection(new core_kernel_classes_Property(PROPERTY_CALLOFSERVICES_ACTUALPARAMETERIN));
     $propActualParamConstantValue = new core_kernel_classes_Property(PROPERTY_ACTUALPARAMETER_CONSTANTVALUE);
     $propActualParamFormalParam = new core_kernel_classes_Property(PROPERTY_ACTUALPARAMETER_FORMALPARAMETER);
     $propFormalParamName = new core_kernel_classes_Property(PROPERTY_FORMALPARAMETER_NAME);
     foreach ($inParameterCollection->getIterator() as $inParameter) {
         $formalParameter = $inParameter->getUniquePropertyValue($propActualParamFormalParam);
         if ($formalParameter->getUri() == 'http://www.tao.lu/Ontologies/TAODelivery.rdf#FormalParamItemUri') {
             $inParameterConstant = $inParameter->getOnePropertyValue($propActualParamConstantValue);
             if (!is_null($inParameterConstant) && $inParameterConstant instanceof core_kernel_classes_Resource) {
                 return $inParameterConstant;
             } else {
                 throw new common_exception_InconsistentData('missing item constant for service ' . $service->getUri());
             }
         }
     }
     throw new common_exception_InconsistentData('no item parameter for ' . $service->getUri());
 }
开发者ID:llecaque,项目名称:extension-tao-update,代码行数:19,代码来源:class.UpdateDeliveryCompilation.php

示例3: testRemoveStatement

 public function testRemoveStatement()
 {
     $true = new core_kernel_classes_Resource(GENERIS_TRUE, __METHOD__);
     $predicate = RDFS_SEEALSO;
     $property = new core_kernel_classes_Property($predicate, __METHOD__);
     $this->assertTrue($this->object->setStatement(GENERIS_TRUE, $predicate, 'test', 'EN'));
     $remove = $this->object->removeStatement(GENERIS_TRUE, $predicate, 'test', 'EN');
     $this->assertTrue($remove);
     $value = $true->getPropertyValuesCollection($property);
     $this->assertTrue($value->isEmpty());
 }
开发者ID:swapnilaptara,项目名称:tao-aptara-assess,代码行数:11,代码来源:ApiModelTest.php

示例4: isIsolatedConnector

 /**
  * Short description of method isIsolatedConnector
  *
  * @access public
  * @author Joel Bout, <joel.bout@tudor.lu>
  * @param  Resource connector
  * @return boolean
  */
 public function isIsolatedConnector(core_kernel_classes_Resource $connector)
 {
     $returnValue = (bool) false;
     $returnValue = true;
     //need to be initiated as true
     $propNextActivities = new core_kernel_classes_Property(PROPERTY_STEP_NEXT);
     foreach ($connector->getPropertyValuesCollection($propNextActivities)->getIterator() as $nextActivityOrConnector) {
         if ($this->activityService->isActivity($nextActivityOrConnector)) {
             $returnValue = false;
         } else {
             if ($this->connectorService->isConnector($nextActivityOrConnector)) {
                 $isolated = $this->isIsolatedConnector($nextActivityOrConnector);
                 if ($returnValue) {
                     $returnValue = $isolated;
                 }
             } else {
                 throw new common_exception_Error('the next acitivty of "' . $connector->getUri() . '" is neither an activity nor a connector');
             }
         }
     }
     if ($returnValue) {
         $this->isolatedConnectors[$connector->getUri()] = $connector;
     }
     return (bool) $returnValue;
 }
开发者ID:oat-sa,项目名称:extension-tao-wfauthoring,代码行数:33,代码来源:class.ProcessChecker.php

示例5: evaluateSPX

 /**
  * Short description of method evaluateSPX
  *
  * @access protected
  * @author firstname and lastname of author, <author@example.org>
  * @param  array $variable
  * @return mixed
  */
 protected function evaluateSPX($variable = array())
 {
     common_Logger::d('SPX TYPE', array('Generis Term evaluateSPX'));
     $resource = $this->getUniquePropertyValue(new core_kernel_classes_Property(PROPERTY_TERM_SPX_SUBJET));
     if ($resource instanceof core_kernel_classes_Resource) {
         if (array_key_exists($resource->getUri(), $variable)) {
             common_Logger::d('Variable uri : ' . $resource->getUri() . ' found', array('Generis Term evaluateSPX'));
             common_Logger::d('Variable name : ' . $resource->getLabel() . ' found', array('Generis Term evaluateSPX'));
             $resource = new core_kernel_classes_Resource($variable[$resource->getUri()]);
             common_Logger::d('Variable repaced uri : ' . $resource->getUri(), array('Generis Term evaluateSPX'));
             common_Logger::d('Variable repaced name : ' . $resource->getLabel(), array('Generis Term evaluateSPX'));
         }
         try {
             $propertyInstance = $this->getUniquePropertyValue(new core_kernel_classes_Property(PROPERTY_TERM_SPX_PREDICATE));
         } catch (common_Exception $e) {
             echo $e;
             var_dump($this);
             die('unable to get property value in Term');
         }
         //    		if(array_key_exists($propertyInstance->getUri(),$variable)) {
         //				$logger->debug('Variable uri : ' .  $propertyInstance->getUri() . ' found' , __FILE__, __LINE__);
         //    			$logger->debug('Variable name : ' .  $propertyInstance->getLabel() . ' found' , __FILE__, __LINE__);
         //				$propertyInstance = new core_kernel_classes_Resource($variable[$resource->getUri()]);
         //    			$logger->debug('Variable repaced uri : ' .  $propertyInstance->getUri() , __FILE__, __LINE__);
         //    			$logger->debug('Variable repaced name : ' .  $propertyInstance->getLabel() , __FILE__, __LINE__);
         //    	    }
         $property = new core_kernel_classes_Property($propertyInstance->getUri());
         common_Logger::d('Property uri ' . $property->getUri(), array('Generis Term evaluateSPX'));
         common_Logger::d('Property name ' . $property->getLabel(), array('Generis Term evaluateSPX'));
         $returnValue = $resource->getPropertyValuesCollection($property);
         common_Logger::d($returnValue->count() . ' values returned ', array('Generis Term evaluateSPX'));
         if ($returnValue->isEmpty()) {
             $newEmptyTerm = new core_kernel_rules_Term(INSTANCE_TERM_IS_NULL, __METHOD__);
             common_Logger::d('Empty Term Created', array('Generis Term evaluateSPX'));
             $property = new core_kernel_classes_Property(PROPERTY_TERM_VALUE);
             $returnValue = $newEmptyTerm->getUniquePropertyValue($property);
         } else {
             if ($returnValue->count() == 1) {
                 $returnValue = $returnValue->get(0);
             }
         }
     }
     return $returnValue;
 }
开发者ID:swapnilaptara,项目名称:tao-aptara-assess,代码行数:52,代码来源:class.Term.php

示例6: cloneInstanceProperty

 /**
  * 
  * @author Lionel Lecaque, lionel@taotesting.com
  * @param core_kernel_classes_Resource $source
  * @param core_kernel_classes_Resource $destination
  * @param core_kernel_classes_Property $property
  */
 protected function cloneInstanceProperty(core_kernel_classes_Resource $source, core_kernel_classes_Resource $destination, core_kernel_classes_Property $property)
 {
     $range = $property->getRange();
     // Avoid doublons, the RDF TYPE property will be set by the implementation layer
     if ($property->getUri() != RDF_TYPE) {
         foreach ($source->getPropertyValuesCollection($property)->getIterator() as $propertyValue) {
             if (!is_null($range) && $range->getUri() == CLASS_GENERIS_FILE) {
                 $file = new core_kernel_versioning_File($propertyValue->getUri());
                 $newFile = $file->getRepository()->spawnFile($file->getAbsolutePath(), $file->getLabel());
                 $destination->setPropertyValue($property, $newFile);
             } else {
                 $destination->setPropertyValue($property, $propertyValue);
             }
         }
     }
 }
开发者ID:nagyist,项目名称:tao-core,代码行数:23,代码来源:class.GenerisService.php

示例7: getProcessVars

 /**
  * Short description of method getProcessVars
  *
  * @access public
  * @author Joel Bout, <joel.bout@tudor.lu>
  * @param  Resource processDefinition
  * @return array
  */
 public function getProcessVars(core_kernel_classes_Resource $processDefinition)
 {
     $returnValue = array();
     $rangeProp = new core_kernel_classes_Property(RDFS_RANGE);
     $widgetProp = new core_kernel_classes_Property(PROPERTY_WIDGET);
     $variables = $processDefinition->getPropertyValuesCollection($this->processVariablesProp);
     $returnValue[RDFS_LABEL] = array('name' => "Name", 'widgets' => WIDGET_FTE, 'range' => RDFS_LITERAL);
     foreach ($variables->getIterator() as $variable) {
         $widgets = $variable->getPropertyValues($widgetProp);
         $label = $variable->getLabel();
         $range = $variable->getPropertyValues($rangeProp);
         $returnValue[$variable->getUri()] = array('name' => trim(strip_tags($label)), 'widgets' => $widgets, 'range' => $range);
     }
     return (array) $returnValue;
 }
开发者ID:nagyist,项目名称:extension-tao-wfengine,代码行数:23,代码来源:class.ProcessDefinitionService.php

示例8: getServicesByActivity

 /**
  * Short description of method getServicesByActivity
  *
  * @access public
  * @author Joel Bout, <joel.bout@tudor.lu>
  * @param  Resource activity
  * @return array
  */
 public function getServicesByActivity(core_kernel_classes_Resource $activity)
 {
     $returnValue = array();
     $services = $activity->getPropertyValuesCollection(new core_kernel_classes_Property(PROPERTY_ACTIVITIES_INTERACTIVESERVICES));
     foreach ($services->getIterator() as $service) {
         if ($service instanceof core_kernel_classes_Resource) {
             $returnValue[$service->getUri()] = $service;
         }
     }
     return (array) $returnValue;
 }
开发者ID:oat-sa,项目名称:extension-tao-wfauthoring,代码行数:19,代码来源:class.ProcessService.php

示例9: nextActivityElements

 public static function nextActivityElements(core_kernel_classes_Resource $connector, $type, $allowCreation = true, $includeConnectors = true, $optionsWidget = 'Combobox')
 {
     $returnValue = array();
     $authorizedOptionsWidget = array('Combobox', 'Checkbox');
     if (!in_array($optionsWidget, $authorizedOptionsWidget)) {
         throw new Exception('Wrong type of widget');
         return $returnValue;
     }
     $idPrefix = '';
     $nextActivity = null;
     $propTransitionRule = new core_kernel_classes_Property(PROPERTY_CONNECTORS_TRANSITIONRULE);
     $propNextActivities = new core_kernel_classes_Property(PROPERTY_STEP_NEXT);
     //find the next activity if available
     switch (strtolower($type)) {
         case 'next':
             $nextActivityCollection = $connector->getPropertyValuesCollection($propNextActivities);
             foreach ($nextActivityCollection->getIterator() as $activity) {
                 if ($activity instanceof core_kernel_classes_Resource) {
                     $nextActivity = $activity;
                     //we take the last one...(note: there should be only one though)
                 }
             }
             $idPrefix = 'next';
             break;
         case 'then':
             $transitionRuleCollection = $connector->getPropertyValuesCollection($propTransitionRule);
             foreach ($transitionRuleCollection->getIterator() as $transitionRule) {
                 if ($transitionRule instanceof core_kernel_classes_Resource) {
                     foreach ($transitionRule->getPropertyValuesCollection(new core_kernel_classes_Property(PROPERTY_TRANSITIONRULES_THEN))->getIterator() as $then) {
                         if ($then instanceof core_kernel_classes_Resource) {
                             $nextActivity = $then;
                         }
                     }
                 }
             }
             $idPrefix = 'then';
             break;
         case 'else':
             $transitionRuleCollection = $connector->getPropertyValuesCollection($propTransitionRule);
             foreach ($transitionRuleCollection->getIterator() as $transitionRule) {
                 if ($transitionRule instanceof core_kernel_classes_Resource) {
                     foreach ($transitionRule->getPropertyValuesCollection(new core_kernel_classes_Property(PROPERTY_TRANSITIONRULES_ELSE))->getIterator() as $else) {
                         if ($else instanceof core_kernel_classes_Resource) {
                             $nextActivity = $else;
                         }
                     }
                 }
             }
             $idPrefix = 'else';
             break;
         case 'parallel':
             $nextActivity = array();
             $nextActivityCollection = $connector->getPropertyValuesCollection($propNextActivities);
             foreach ($nextActivityCollection->getIterator() as $cardinality) {
                 if ($cardinality instanceof core_kernel_classes_Resource) {
                     $nextActivity[] = $cardinality;
                 }
             }
             $idPrefix = 'parallel';
             break;
         case 'join':
             // should only have one following activity
             $nextActivity = $connector->getOnePropertyValue($propNextActivities);
             $idPrefix = $type;
             break;
         default:
             throw new Exception("unknown type for the next activity");
     }
     $activityOptions = array();
     $connectorOptions = array();
     if ($allowCreation) {
         //create the activity label element (used only in case of new activity craetion)
         $elementActivityLabel = tao_helpers_form_FormFactory::getElement($idPrefix . "_activityLabel", 'Textbox');
         $elementActivityLabel->setDescription(__('Label'));
         //add the "creating" option
         $activityOptions["newActivity"] = __("create new activity");
         $connectorOptions["newConnector"] = __("create new connector");
     }
     //the activity associated to the connector:
     $referencedActivity = $connector->getUniquePropertyValue(new core_kernel_classes_Property(PROPERTY_CONNECTORS_ACTIVITYREFERENCE));
     //mandatory property value, initiated at the connector creation
     if ($referencedActivity instanceof core_kernel_classes_Resource) {
         $processDefClass = new core_kernel_classes_Class(CLASS_PROCESS);
         $processes = $processDefClass->searchInstances(array(PROPERTY_PROCESS_ACTIVITIES => $referencedActivity->getUri()), array('like' => false));
         if (count($processes) > 0) {
             $process = array_shift($processes);
             if (!empty($process)) {
                 //get list of activities and connectors for the current process:
                 $connectorClass = new core_kernel_classes_Class(CLASS_CONNECTORS);
                 $processAuthoringService = wfAuthoring_models_classes_ProcessService::singleton();
                 $activities = $processAuthoringService->getActivitiesByProcess($process);
                 foreach ($activities as $activityTemp) {
                     //include activities options:
                     $encodedUri = tao_helpers_Uri::encode($activityTemp->getUri());
                     $activityOptions[$encodedUri] = $activityTemp->getLabel();
                     if (strtolower($type) == 'parallel') {
                         $elementHidden = tao_helpers_form_FormFactory::getElement("{$encodedUri}_num_hidden", 'Hidden');
                         $returnValue[$idPrefix . '_' . $activityTemp->getUri()] = $elementHidden;
                     }
                     //include connectors options:
//.........这里部分代码省略.........
开发者ID:oat-sa,项目名称:extension-tao-wfauthoring,代码行数:101,代码来源:class.ProcessFormFactory.php

示例10: getItemByService

 public function getItemByService(core_kernel_classes_Resource $service)
 {
     $returnValue = null;
     $propertyIterator = $service->getPropertyValuesCollection(new core_kernel_classes_Property(PROPERTY_CALLOFSERVICES_ACTUALPARAMETERIN))->getIterator();
     foreach ($propertyIterator as $actualParam) {
         $formalParam = $actualParam->getUniquePropertyValue(new core_kernel_classes_Property(PROPERTY_ACTUALPARAMETER_FORMALPARAMETER));
         if ($formalParam->getUniquePropertyValue(new core_kernel_classes_Property(PROPERTY_FORMALPARAMETER_NAME)) == 'itemUri') {
             $returnValue = $actualParam->getOnePropertyValue(new core_kernel_classes_Property(PROPERTY_ACTUALPARAMETER_CONSTANTVALUE));
             break;
         }
     }
     return $returnValue;
 }
开发者ID:nagyist,项目名称:extension-tao-testwf,代码行数:13,代码来源:class.WfTestService.php

示例11: getUserRoles

 /**
  * Get the roles that a given user has.
  *
  * @access public
  * @author Jerome Bogaerts, <jerome@taotesting.com>
  * @param  Resource user A Generis User.
  * @return array
  */
 public function getUserRoles(core_kernel_classes_Resource $user)
 {
     $returnValue = array();
     // We use a Depth First Search approach to flatten the Roles Graph.
     $rolesProperty = new core_kernel_classes_Property(PROPERTY_USER_ROLES);
     $rootRoles = $user->getPropertyValuesCollection($rolesProperty);
     foreach ($rootRoles->getIterator() as $r) {
         $returnValue[$r->getUri()] = $r;
         $returnValue = array_merge($returnValue, $this->getIncludedRoles($r));
     }
     $returnValue = array_unique($returnValue);
     return (array) $returnValue;
 }
开发者ID:oat-sa,项目名称:generis,代码行数:21,代码来源:class.Service.php


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