public function add(PriorityQueueItem $item) {
        $priority = $item->getPriority();
        if (!isset($this->items[$priority])) {
            $this->items[$priority] = array($item);
        } else {
            $this->items[$priority][] = $item;
        }
        return $this;
    }
public function add(PriorityQueueItem $item) {
        $priority = $item->getPriority();
        if (!isset($this->items[$priority])) {
            $this->items[$priority] = array($item);
        } else {
            $this->items[$priority][] = $item;
        }
        return $this;
    }
public function add ( PriorityQueueItem $ item ) { $ priority = $ item -> getPriority ( ) ; if ( ! isset ( $ this -> items [ $ priority ] ) ) { $ this -> items [ $ priority ] = array ( $ item ) ; } else { $ this -> items [ $ priority ] [ ] = $ item ; } return $ this ; }
Adds a new item to the priority queue.
@param PriorityQueueItem $item THe item to be added.
@return $this Implementing fluent interface.
Adds a new item to the priority queue .