File: Array.php

package info (click to toggle)
php-horde-queue 1.1.5-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 120 kB
  • sloc: xml: 192; php: 148; makefile: 2
file content (18 lines) | stat: -rw-r--r-- 372 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php
/**
 * Stores queue tasks in the current request. No persistence.
 */
class Horde_Queue_Storage_Array extends Horde_Queue_Storage
{
    protected $_tasks = array();

    public function add(Horde_Queue_Task $task)
    {
        $this->_tasks[] = $task;
    }

    public function getMany($num = 50)
    {
        return array_splice($this->_tasks, 0, $num);
    }
}