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


PHP Sequence::lookup方法代码示例

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


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

示例1: current

 /**
  * Ajax: GET /sequence/<id>
  *
  * Fetches the current value of a sequence
  *
  * Get-Arguments:
  * format - (string) format string used to format the current value of
  *      the sequence.
  *
  * Returns:
  * (string) Current sequence number, optionally formatted
  *
  * Throws:
  * 403 - Not logged in
  * 404 - Unknown sequence id
  * 422 - Invalid sequence id
  */
 function current($id)
 {
     global $thisstaff;
     if (!$thisstaff) {
         Http::response(403, 'Login required');
     } elseif ($id == 0) {
         $sequence = new RandomSequence();
     } elseif (!$id || !is_numeric($id)) {
         Http::response(422, 'Id is required');
     } elseif (!($sequence = Sequence::lookup($id))) {
         Http::response(404, 'No such object');
     }
     return $sequence->current($_GET['format']);
 }
开发者ID:ayurmedia,项目名称:osTicket-1.8,代码行数:31,代码来源:ajax.sequence.php

示例2: __

                <?php 
echo __('Default Ticket Number Format');
?>
:
            </td>
            <td>
                <input type="text" name="number_format" value="<?php 
echo $config['number_format'];
?>
"/>
                <span class="faded"><?php 
echo __('e.g.');
?>
 <span id="format-example"><?php 
if ($config['sequence_id']) {
    $seq = Sequence::lookup($config['sequence_id']);
}
if (!isset($seq)) {
    $seq = new RandomSequence();
}
echo $seq->current($config['number_format']);
?>
</span></span>
                <i class="help-tip icon-question-sign" href="#number_format"></i>
                <div class="error"><?php 
echo $errors['number_format'];
?>
</div>
            </td>
        </tr>
        <tr><td width="220"><?php 
开发者ID:jmangarret,项目名称:ostickets,代码行数:31,代码来源:settings-tickets.inc.php

示例3: getNewTicketNumber

 function getNewTicketNumber()
 {
     global $cfg;
     if (!$this->hasFlag(self::FLAG_CUSTOM_NUMBERS)) {
         return $cfg->getNewTicketNumber();
     }
     if ($this->ht['sequence_id']) {
         $sequence = Sequence::lookup($this->ht['sequence_id']);
     }
     if (!$sequence) {
         $sequence = new RandomSequence();
     }
     return $sequence->next($this->ht['number_format'] ?: '######', array('Ticket', 'isTicketNumberUnique'));
 }
开发者ID:ayurmedia,项目名称:osTicket-1.8,代码行数:14,代码来源:class.topic.php

示例4: getDefaultSequence

 function getDefaultSequence()
 {
     if ($this->get('sequence_id')) {
         $sequence = Sequence::lookup($this->get('sequence_id'));
     }
     if (!$sequence) {
         $sequence = new RandomSequence();
     }
     return $sequence;
 }
开发者ID:gizur,项目名称:osticket,代码行数:10,代码来源:class.config.php

示例5: __

echo __('Format');
?>
:
            </td>
            <td>
                <input type="text" name="number_format" value="<?php 
echo $info['number_format'];
?>
"/>
                <span class="faded"><?php 
echo __('e.g.');
?>
 <span id="format-example"><?php 
if ($info['custom-numbers']) {
    if ($info['sequence_id']) {
        $seq = Sequence::lookup($info['sequence_id']);
    }
    if (!isset($seq)) {
        $seq = new RandomSequence();
    }
    echo $seq->current($info['number_format']);
}
?>
</span></span>
                <div class="error"><?php 
echo $errors['number_format'];
?>
</div>
            </td>
        </tr>
        <tr>
开发者ID:ayurmedia,项目名称:osTicket-1.8,代码行数:31,代码来源:helptopic.inc.php


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