當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。