Zend Framework  3.0
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
PriorityList Class Reference

Public Member Functions

 insert ($name, $value, $priority=0)
 Insert a new item.
 
 setPriority ($name, $priority)
 
 remove ($name)
 Remove a item.
 
 clear ()
 Remove all items.
 
 get ($name)
 Get a item.
 
 isLIFO ($flag=null)
 Get/Set serial order mode.
 
 rewind ()
 
 
 current ()
 
 
 key ()
 
 
 next ()
 
 
 valid ()
 
 
 getIterator ()
 
 count ()
 
 
 toArray ($flag=self::EXTR_DATA)
 Return list as array.
 

Public Attributes

const EXTR_DATA = 0x00000001
 
const EXTR_PRIORITY = 0x00000002
 
const EXTR_BOTH = 0x00000003
 

Protected Member Functions

 sort ()
 Sort all items.
 
 compare (array $item1, array $item2)
 Compare the priority of two items.
 

Protected Attributes

 $items = []
 
 $serial = 0
 
 $isLIFO = 1
 
 $count = 0
 
 $sorted = false
 

Member Function Documentation

clear ( )

Remove all items.

Returns
void
compare ( array  $item1,
array  $item2 
)
protected

Compare the priority of two items.

Parameters
array$item1,@paramarray $item2
Returns
int
count ( )

current ( )

get (   $name)

Get a item.

Parameters
string$name
Returns
mixed
getIterator ( )
Returns
self
insert (   $name,
  $value,
  $priority = 0 
)

Insert a new item.

Parameters
string$name
mixed$value
int$priority
Returns
void
isLIFO (   $flag = null)

Get/Set serial order mode.

Parameters
bool | null$flag
Returns
bool
key ( )

next ( )

remove (   $name)

Remove a item.

Parameters
string$name
Returns
void
rewind ( )

setPriority (   $name,
  $priority 
)
Parameters
string$name
int$priority
Returns
$this
Exceptions
\Exception
sort ( )
protected

Sort all items.

Returns
void
toArray (   $flag = self::EXTR_DATA)

Return list as array.

Parameters
int$flag
Returns
array
valid ( )

Member Data Documentation

$count = 0
protected
$isLIFO = 1
protected
$items = []
protected
$serial = 0
protected
$sorted = false
protected
const EXTR_BOTH = 0x00000003
const EXTR_DATA = 0x00000001
const EXTR_PRIORITY = 0x00000002