本文整理汇总了PHP中Queue::next方法的典型用法代码示例。如果您正苦于以下问题:PHP Queue::next方法的具体用法?PHP Queue::next怎么用?PHP Queue::next使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Queue
的用法示例。
在下文中一共展示了Queue::next方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: next
public function next()
{
$limit = array_shift($this->args);
$this->out('Retrieving Queue List.');
$queue = Queue::next($limit, false);
$i = 1;
foreach ($queue as $task) {
$this->out($i . ') ' . Queue::view($task['QueueTask']['id']));
$i++;
}
}
示例2: next
public function next()
{
$limit = array_shift($this->args);
$minimal = filter_var(array_shift($this->args), FILTER_VALIDATE_BOOLEAN);
if (!$minimal) {
$this->out('Retrieving Queue List.');
}
$queue = Queue::next($limit);
$i = 1;
foreach ($queue as $task) {
if ($minimal) {
print $task['QueueTask']['id'] . "\r\n";
} else {
$this->out($i . ') ' . Queue::view($task['QueueTask']['id']));
}
$i++;
}
}
示例3: queryQueue
/**
* Run a database query for each Query in the Queue and return a Queue of QueryResults.
* @param object QueueInterface A queue object which holds the queries to run.
* @param integer $dbIndex The index of the database on which to run the query. Default is 0, the database created on handler instantiation.
* @return object QueInterface Returns a Queue of QueryResults.
* @access public
*/
function queryQueue(Queue $queue, $dbIndex = 0)
{
if (isset($this->recordQueryCallers) && $this->recordQueryCallers) {
if (!isset($this->queryCallers)) {
$this->queryCallers = array();
}
$backtrace = debug_backtrace();
$this->queryCallers[] = $backtrace[1]['class'] . $backtrace[1]['type'] . $backtrace[1]['function'] . "()";
}
// ** parameter validation
$this->_validateDBIndex($dbIndex);
// ** end of parameter validation
$resultQueue = new Queue();
while ($queue->hasNext()) {
$result = $this->_databases[$dbIndex]->query($queue->next());
$resultQueue->add($result);
}
return $resultQueue;
}
示例4: testRewind
function testRewind()
{
$testReversedQueue = new Queue();
$test1 = new Queue();
$test2 = new Queue();
$test3 = new Queue();
$test4 = new Queue();
$test5 = new Queue();
$testReversedQueue->add($test1);
$testReversedQueue->add($test2);
$testReversedQueue->add($test3);
$this->assertReference($test1, $testReversedQueue->next());
$this->assertReference($test2, $testReversedQueue->next());
$testReversedQueue->rewind();
$this->assertReference($test1, $testReversedQueue->next());
}