PHP Interface Kraken\Util\Factory\FactoryInterface

Show file Open project: kraken-php/framework

Public Methods

Method Description
bindParam ( string $name, mixed $value ) : Kraken\Util\Factory\FactoryInterface Bind param $value under $name key to Factory.
create ( string $name, mixed[] $args = [] ) : mixed Create object with given arguments using factoryMethod stored under $name key.
define ( string $name, callable $factoryMethod ) : Kraken\Util\Factory\FactoryInterface Define factory method for some object and register in under $name key.
getDefinition ( string $name ) : callable Return factory method definition stored under $name key.
getDefinitions ( ) : callable[] Return all definitions stored in Factory in the form of associative array.
getParam ( string $name ) : mixed Get param stored under $name key.
getParams ( ) : mixed[] Return all params stored in Factory in the form of associative array.
hasDefinition ( string $name ) : boolean Check if there is any factory method definition stored under $name key.
hasParam ( string $param ) : boolean Check if there is any param under $param $key.
remove ( string $name ) : Kraken\Util\Factory\FactoryInterface Remove factory method definition stored under $name key.
unbindParam ( string $name ) : Kraken\Util\Factory\FactoryInterface Unbind param stored under $name key from Factory.

Method Details

bindParam() public method

Bind param $value under $name key to Factory.
public bindParam ( string $name, mixed $value ) : Kraken\Util\Factory\FactoryInterface
$name string
$value mixed
return Kraken\Util\Factory\FactoryInterface

create() public method

Create object with given arguments using factoryMethod stored under $name key. Throws exception if there is no definition stored.
public create ( string $name, mixed[] $args = [] ) : mixed
$name string
$args mixed[]
return mixed

define() public method

Define factory method for some object and register in under $name key.
public define ( string $name, callable $factoryMethod ) : Kraken\Util\Factory\FactoryInterface
$name string
$factoryMethod callable
return Kraken\Util\Factory\FactoryInterface

getDefinition() public method

Return factory method definition stored under $name key.
public getDefinition ( string $name ) : callable
$name string
return callable

getDefinitions() public method

Return all definitions stored in Factory in the form of associative array.
public getDefinitions ( ) : callable[]
return callable[]

getParam() public method

Get param stored under $name key. Throws exception if there is no param set under $name key.
public getParam ( string $name ) : mixed
$name string
return mixed

getParams() public method

Return all params stored in Factory in the form of associative array.
public getParams ( ) : mixed[]
return mixed[]

hasDefinition() public method

Check if there is any factory method definition stored under $name key.
public hasDefinition ( string $name ) : boolean
$name string
return boolean

hasParam() public method

Check if there is any param under $param $key.
public hasParam ( string $param ) : boolean
$param string
return boolean

remove() public method

Remove factory method definition stored under $name key.
public remove ( string $name ) : Kraken\Util\Factory\FactoryInterface
$name string
return Kraken\Util\Factory\FactoryInterface

unbindParam() public method

Unbind param stored under $name key from Factory.
public unbindParam ( string $name ) : Kraken\Util\Factory\FactoryInterface
$name string
return Kraken\Util\Factory\FactoryInterface