PHP Class Habari\StackItem

This class represents a single item that can be used as a component in Habari's stack output
Mostra file Open project: habari/system

Public Properties

Property Type Description
$dependencies
$items
$resource

Public Methods

Method Description
__construct ( string $name, string $version, mixed $resource ) Constructor for StackItem
__get ( $name )
__toString ( ) : string Define behavior for when this StackItem is cast to a string
add_dependency ( string | StackItem $itemname, null | string $version = null ) : StackItem Add a dependency to this StackItem
get ( string $name, string $version = null ) Get the named stack item
get_dependencies ( ) : array Get the dependencies for this item
in_stack_index ( Array $stack ) : boolean Determine if this item is in the specified stack array
register ( string $name, string $resource = '', string $version ) : StackItem

Method Details

__construct() public method

Constructor for StackItem
public __construct ( string $name, string $version, mixed $resource )
$name string Name of the item
$version string PHP version string-compatible version number
$resource mixed Value of the item

__get() public method

public __get ( $name )

__toString() public method

Define behavior for when this StackItem is cast to a string
public __toString ( ) : string
return string

add_dependency() public method

Add a dependency to this StackItem
public add_dependency ( string | StackItem $itemname, null | string $version = null ) : StackItem
$itemname string | StackItem The name of the stack item upon which this item depends
$version null | string Optional PHP-compatible version number string
return StackItem Fluid interface returns $this

get() public static method

Get the named stack item
public static get ( string $name, string $version = null )
$name string Name of the stack item to get
$version string (optional) Minimum version number of the item to get

get_dependencies() public method

Get the dependencies for this item
public get_dependencies ( ) : array
return array An array of StackItems that this item depends on

in_stack_index() public method

Determine if this item is in the specified stack array
public in_stack_index ( Array $stack ) : boolean
$stack Array The stack to look in for this item
return boolean True if the stack contains an index that matches this item's name

register() public static method

public static register ( string $name, string $resource = '', string $version ) : StackItem
$name string Name of the item to register
$resource string The resource to
$version string Verison of the item to register
return StackItem

Property Details

$dependencies public_oe property

public $dependencies

$items static_oe public_oe property

static public $items

$resource public_oe property

public $resource