The EIQueue object implements the FIFO Queue data structure of type int and the Singleton design pattern

 Methods

Add an int to the queue.

add($int) 

Parameters

$int

Add an array of ints to the queue.

addAll($array) 

Parameters

$array

Empty the queue.

clear() 

Return a clone of the queue (as peek::remove, this::removeAll) - also, not standard.

getClone() : array

Returns

array

Retrieve the single instance of the EIQueue object.

getInstance() : \EIQueue | null
Static

Returns

\EIQueuenull

Return whether the queue is empty or not.

isEmpty() : bool

Returns

bool

Return the element at the top of the queue but do not remove it.

peek() : mixed

Returns

mixed

Remove the first item in the queue, or if passed an int, remove the passed int from the queue, returning true if found, false if not.

remove(null $int) : int | bool

(No, this is not standard.)

Parameters

$int

null

Returns

intbool

Remove and return all elements in the queue.

removeAll() : mixed

Returns

mixed

Return the current size of the queue.

size() : int

Returns

int

Construct a queue from the unserialized drupal variable

__construct() 
access private

Serialize and save the queue to a drupal variable.

save() 
access private

 Properties

 

$instance : null
 

$q : \array<int>
access private