本文整理汇总了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;
}
示例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;
}
示例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));
}