FileAccess Orion

PriorityList
in package
implements Iterator, Countable

Interfaces, Classes, Traits and Enums

Iterator
Countable

Table of Contents

EXTR_BOTH  = 0x3
EXTR_DATA  = 0x1
EXTR_PRIORITY  = 0x2
$count  : int
Internal counter to avoid usage of count().
$isLIFO  : int
Serial order mode
$items  : array<string|int, array<string|int, mixed>>
Internal list of all items.
$serial  : int
Serial assigned to items to preserve LIFO.
$sorted  : bool
Whether the list was already sorted.
clear()  : void
Remove all items.
count()  : mixed
{@inheritDoc}
current()  : mixed
{@inheritDoc}
get()  : mixed
Get a item.
getIterator()  : self
insert()  : void
Insert a new item.
isLIFO()  : bool
Get/Set serial order mode
key()  : mixed
{@inheritDoc}
next()  : mixed
{@inheritDoc}
remove()  : void
Remove a item.
rewind()  : mixed
{@inheritDoc}
setPriority()  : $this
toArray()  : array<string|int, mixed>
Return list as array
valid()  : mixed
{@inheritDoc}
compare()  : int
Compare the priority of two items.
sort()  : void
Sort all items.

Constants

Properties

$count

Internal counter to avoid usage of count().

protected int $count = 0

$items

Internal list of all items.

protected array<string|int, array<string|int, mixed>> $items = []

$serial

Serial assigned to items to preserve LIFO.

protected int $serial = 0

$sorted

Whether the list was already sorted.

protected bool $sorted = false

Methods

clear()

Remove all items.

public clear() : void
Return values
void

count()

{@inheritDoc}

public count() : mixed
Return values
mixed

current()

{@inheritDoc}

public current() : mixed
Return values
mixed

get()

Get a item.

public get(string $name) : mixed
Parameters
$name : string
Return values
mixed

getIterator()

public getIterator() : self
Return values
self

insert()

Insert a new item.

public insert(string $name, mixed $value, int $priority) : void
Parameters
$name : string
$value : mixed
$priority : int
Return values
void

isLIFO()

Get/Set serial order mode

public isLIFO([bool|null $flag = null ]) : bool
Parameters
$flag : bool|null = null
Return values
bool

key()

{@inheritDoc}

public key() : mixed
Return values
mixed

next()

{@inheritDoc}

public next() : mixed
Return values
mixed

remove()

Remove a item.

public remove(string $name) : void
Parameters
$name : string
Return values
void

rewind()

{@inheritDoc}

public rewind() : mixed
Return values
mixed

setPriority()

public setPriority(string $name, int $priority) : $this
Parameters
$name : string
$priority : int
Tags
throws
Exception
Return values
$this

toArray()

Return list as array

public toArray([int $flag = self::EXTR_DATA ]) : array<string|int, mixed>
Parameters
$flag : int = self::EXTR_DATA
Return values
array<string|int, mixed>

valid()

{@inheritDoc}

public valid() : mixed
Return values
mixed

compare()

Compare the priority of two items.

protected compare(array<string|int, mixed> $item1, array<string|int, mixed> $item2) : int
Parameters
$item1 : array<string|int, mixed>
$item2 : array<string|int, mixed>
Return values
int

sort()

Sort all items.

protected sort() : void
Return values
void

Search results