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


PHP Tracker_FormElementFactory::getUsedFieldByName方法代码示例

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


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

示例1: getFieldByName

 private function getFieldByName(Tracker $tracker, $field_name)
 {
     $field = $this->formelement_factory->getUsedFieldByName($tracker->getId(), $field_name);
     if (!$field) {
         throw new Tracker_FormElement_InvalidFieldException("Field {$field_name} does not exist in the tracker");
     }
     return $field;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:8,代码来源:ArtifactValidator.class.php

示例2: getArtifactDataFromSoapRequest

 private function getArtifactDataFromSoapRequest(Tracker $tracker, $values, Tracker_Artifact $artifact = null)
 {
     $fields_data = array();
     foreach ($values as $field_value) {
         // field are identified by name, we need to retrieve the field id
         if ($field_value->field_name) {
             $field = $this->formelement_factory->getUsedFieldByName($tracker->getId(), $field_value->field_name);
             if ($field) {
                 $field_data = $field->getFieldDataFromSoapValue($field_value, $artifact);
                 if ($field_data !== null) {
                     // $field_value is an object: SOAP must cast it in ArtifactFieldValue
                     if (isset($fields_data[$field->getId()])) {
                         if (!is_array($fields_data[$field->getId()])) {
                             $fields_data[$field->getId()] = array($fields_data[$field->getId()]);
                         }
                         $fields_data[$field->getId()][] = $field_data;
                     } else {
                         $fields_data[$field->getId()] = $field_data;
                     }
                 } else {
                     throw new SoapFault(update_artifact_fault, 'Unknown value ' . print_r($field_value->field_value, true) . ' for field: ' . $field_value->field_name);
                 }
             } else {
                 throw new SoapFault(update_artifact_fault, 'Unknown field: ' . $field_value->field_name);
             }
         }
     }
     return $fields_data;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:29,代码来源:SOAPServer.class.php

示例3: getFieldsData

 /**
  * @return array
  */
 public function getFieldsData(SimpleXMLElement $xml_field_change)
 {
     $data = array();
     if (!$xml_field_change->field_change) {
         return $data;
     }
     foreach ($xml_field_change->field_change as $field_change) {
         $field = $this->formelement_factory->getUsedFieldByName($this->tracker->getId(), (string) $field_change['field_name']);
         if ($field) {
             $this->appendValidValue($data, $field, $field_change);
         } else {
             $this->logger->debug("Skipped unknown/unused field " . (string) $field_change['field_name']);
         }
     }
     return $data;
 }
开发者ID:rinodung,项目名称:tuleap,代码行数:19,代码来源:ArtifactFieldsDataBuilder.class.php


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