PHP Interface Kraken\Util\Factory\SimpleFactoryInterface

Afficher le fichier Open project: kraken-php/framework

Méthodes publiques

Méthode Description
bindParam ( string $name, mixed $value ) : Kraken\Util\Factory\FactoryInterface Bind param $value under $name key to Factory.
create ( mixed[] $args = [] ) : mixed Create object with given arguments using factoryMethod stored in Factory.
define ( callable $factoryMethod ) : Kraken\Util\Factory\FactoryInterface Define factory method for some object in Factory.
getDefinition ( ) : callable Return factory method definition stored in Factory.
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 ( ) : boolean Check if there is any factory method definition stored in Factory.
hasParam ( string $param ) : boolean Check if there is any param under $param $key.
unbindParam ( string $name ) : Kraken\Util\Factory\FactoryInterface Unbind param stored under $name key from Factory.

Method Details

bindParam() public méthode

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

create() public méthode

Create object with given arguments using factoryMethod stored in Factory. Throws exception if there is no definition stored.
public create ( mixed[] $args = [] ) : mixed
$args mixed[]
Résultat mixed

define() public méthode

Define factory method for some object in Factory.
public define ( callable $factoryMethod ) : Kraken\Util\Factory\FactoryInterface
$factoryMethod callable
Résultat Kraken\Util\Factory\FactoryInterface

getDefinition() public méthode

Return factory method definition stored in Factory.
public getDefinition ( ) : callable
Résultat callable

getParam() public méthode

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

getParams() public méthode

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

hasDefinition() public méthode

Check if there is any factory method definition stored in Factory.
public hasDefinition ( ) : boolean
Résultat boolean

hasParam() public méthode

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

unbindParam() public méthode

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