本文整理汇总了PHP中MantisEnum::getValue方法的典型用法代码示例。如果您正苦于以下问题:PHP MantisEnum::getValue方法的具体用法?PHP MantisEnum::getValue怎么用?PHP MantisEnum::getValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MantisEnum
的用法示例。
在下文中一共展示了MantisEnum::getValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetValue
/**
* Tests getValue() method.
*/
public function testGetValue()
{
$this->assertEquals(false, MantisEnum::getValue(MantisEnumTest::EMPTY_ENUM, 'viewer'));
$this->assertEquals(10, MantisEnum::getValue(MantisEnumTest::SINGLE_VALUE_ENUM, 'viewer'));
$this->assertEquals(10, MantisEnum::getValue(MantisEnumTest::DUPLICATE_VALUES_ENUM, 'viewer1'));
$this->assertEquals(20, MantisEnum::getValue(MantisEnumTest::NAME_WITH_SPACES_ENUM, 'second label'));
// This is not inconsisent with duplicate values behavior, however, it is considered correct since it simplies the code
// and it is not a real scenario.
$this->assertEquals(20, MantisEnum::getValue(MantisEnumTest::DUPLICATE_LABELS_ENUM, 'viewer'));
}
示例2: mci_get_enum_value_from_label
/**
* Get the enum id given the enum label.
*
* @param $p_enum_string The enum string to search in.
* @param $p_label The label to search for.
*
* @return The id corresponding to the given label, or 0 if not found.
*/
function mci_get_enum_value_from_label($p_enum_string, $p_label)
{
$t_value = MantisEnum::getValue($p_enum_string, $p_label);
if ($t_value === false) {
return 0;
}
return $t_value;
}
示例3: foreach
<td class="scrumcolumn" width="<?php
echo $bug_count > 0 ? $bug_percentage_by_column[$column] : $bug_percentage_by_column;
?>
%">
<?php
foreach ($statuses as $status) {
if (isset($bugs[$status]) || plugin_config_get('show_empty_status')) {
if ($first) {
$first = false;
} else {
?>
<hr />
<?php
}
# Display status name only if different from column header
$column_enum_val = MantisEnum::getValue($status_enum, $column);
if ($column_enum_val != $status) {
?>
<p class="scrumstatus">
<?php
echo get_enum_element('status', $status);
?>
</p><?php
}
if (isset($bugs[$status])) {
foreach ($bugs[$status] as $bug) {
$sevcolor = array_key_exists($bug->severity, $sevcolors) ? $sevcolors[$bug->severity] : 'white';
$rescolor = array_key_exists($bug->resolution, $rescolors) ? $rescolors[$bug->resolution] : 'white';
?>
<div class="scrumblock">
<p class="priority"><?php