Template Sloth
Public Member Functions | Protected Attributes | List of all members
Slot Class Reference

Public Member Functions

 __construct (string $slot_name, Sloth $sloth)
 
 add (int $weight, string $template, array $arguments=[])
 Add a fragment into the slot queue. More...
 
 isEmpty ()
 Returns true if slot is empty. More...
 
 nextFragment ()
 Returns the fragment on top of the queue and removes it (shifts up). More...
 

Protected Attributes

 $sloth
 
 $slot_name
 
 $fragmentQueue
 
 $serial = 1
 

Constructor & Destructor Documentation

◆ __construct()

__construct ( string  $slot_name,
Sloth  $sloth 
)

Member Function Documentation

◆ add()

add ( int  $weight,
string  $template,
array  $arguments = [] 
)

Add a fragment into the slot queue.

◆ isEmpty()

isEmpty ( )

Returns true if slot is empty.

◆ nextFragment()

nextFragment ( )

Returns the fragment on top of the queue and removes it (shifts up).

When queue is empty, null is returned.

Member Data Documentation

◆ $sloth

$sloth
protected

◆ $slot_name

$slot_name
protected

◆ $fragmentQueue

$fragmentQueue
protected

◆ $serial

$serial = 1
protected