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


PHP Tracker_FormElement_Field::getLabel方法代码示例

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


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

示例1: getFieldData

 /**
  * Extract Field data from XML input
  *
  * @param Tracker_FormElement_Field $field
  * @param SimpleXMLElement $field_change
  *
  * @return mixed
  */
 public function getFieldData(Tracker_FormElement_Field $field, SimpleXMLElement $field_change)
 {
     $values = $field_change->value;
     $files_infos = array();
     if ($this->isFieldChangeEmpty($values)) {
         $this->logger->warn('Skipped attachment field ' . $field->getLabel() . ': field value is empty.');
         return $files_infos;
     }
     foreach ($values as $value) {
         try {
             $attributes = $value->attributes();
             $file_id = (string) $attributes['ref'];
             $file = $this->files_importer->getFileXML($file_id);
             if (!$this->files_importer->fileIsAlreadyImported($file_id)) {
                 $files_infos[] = $this->getFileInfoForAttachment($file);
                 $this->files_importer->markAsImported($file_id);
             }
         } catch (Tracker_Artifact_XMLImport_Exception_FileNotFoundException $exception) {
             $this->logger->warn('Skipped attachment field ' . $field->getLabel() . ': ' . $exception->getMessage());
         }
     }
     if ($this->itCannotImportAnyFiles($values, $files_infos)) {
         throw new Tracker_Artifact_XMLImport_Exception_NoValidAttachementsException();
     }
     return $files_infos;
 }
开发者ID:rinodung,项目名称:tuleap,代码行数:34,代码来源:XMLImportFieldStrategyAttachment.class.php

示例2: getFullRESTRepresentation

 protected function getFullRESTRepresentation($value)
 {
     $classname_with_namespace = 'Tuleap\\Tracker\\REST\\Artifact\\ArtifactFieldValueFullRepresentation';
     $artifact_field_value_full_representation = new $classname_with_namespace();
     $artifact_field_value_full_representation->build($this->field->getId(), Tracker_FormElementFactory::instance()->getType($this->field), $this->field->getLabel(), $value);
     return $artifact_field_value_full_representation;
 }
开发者ID:superlinger,项目名称:tuleap,代码行数:7,代码来源:Tracker_Artifact_ChangesetValue.class.php

示例3: stub

 function testValidateSubmitFieldRequiredNotSubmittedNoDefaultValue()
 {
     stub($this->field1)->isValid()->returns(false);
     stub($this->field1)->userCanSubmit()->returns(true);
     stub($this->field1)->isRequired()->returns(true);
     stub($this->field1)->hasDefaultValue()->returns(false);
     stub($this->field2)->isValid()->returns(true);
     stub($this->field3)->isValid()->returns(true);
     stub($this->workflow)->validate()->returns(true);
     $GLOBALS['Language']->expectOnce('getText', array('plugin_tracker_common_artifact', 'err_required', $this->field1->getLabel() . ' (' . $this->field1->getName() . ')'));
     $fields_data = array();
     $this->assertFalse($this->initial_changeset_fields_validator->validate($this->artifact, $fields_data));
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:13,代码来源:FieldsValidatorTest.php


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