本文整理匯總了PHP中Tracker_FormElementFactory::getUsedFieldByNameForUser方法的典型用法代碼示例。如果您正苦於以下問題:PHP Tracker_FormElementFactory::getUsedFieldByNameForUser方法的具體用法?PHP Tracker_FormElementFactory::getUsedFieldByNameForUser怎麽用?PHP Tracker_FormElementFactory::getUsedFieldByNameForUser使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Tracker_FormElementFactory
的用法示例。
在下文中一共展示了Tracker_FormElementFactory::getUsedFieldByNameForUser方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: update
public function update(Tracker $tracker, SimpleXMLElement $artifact_xml, array $submitted_values, PFUser $user, $submitted_on)
{
$artifact_xml->changeset->submitted_on = date('c', $submitted_on);
$artifact_xml->changeset->submitted_by = $user->getId();
foreach ($artifact_xml->changeset->field_change as $field_change) {
$field_name = (string) $field_change['field_name'];
$field = $this->formelement_factory->getUsedFieldByNameForUser($tracker->getId(), $field_name, $user);
if ($field && isset($submitted_values[$field->getId()])) {
$submitted_value = $submitted_values[$field->getId()];
$this->visitor->update($field_change, $field, $submitted_value);
}
}
}
示例2: getTimestamp
private function getTimestamp(PFUser $user, Tracker_Artifact $milestone_artifact, $field_name)
{
$field = $this->formelement_factory->getUsedFieldByNameForUser($milestone_artifact->getTracker()->getId(), $field_name, $user);
if (!$field) {
return 0;
}
$value = $field->getLastChangesetValue($milestone_artifact);
if (!$value) {
return 0;
}
return $value->getTimestamp();
}