Library
Interface

Library\FactoryInterface

interface FactoryInterface

Constants

GRACEFULLY_FAILURE

Constant to use to not throw error if a class is not found or doesn't implement or extend some requirements

ERROR_ON_FAILURE

Constant to use to throw an error if a class is not found or doesn't implement or extend some requirements

Methods

object build(string $name, array $parameters = null, int $flag = self::ERROR_ON_FAILURE, array $logs = array())

Build the object instance following current factory settings

null|string findBuilder(string $name, int $flag = self::ERROR_ON_FAILURE, array $logs = array())

Find the object builder class following current factory settings

Details

at line 54
public object build(string $name, array $parameters = null, int $flag = self::ERROR_ON_FAILURE, array $logs = array())

Build the object instance following current factory settings

Errors are thrown by default but can be "gracefully" skipped using the flag GRACEFULLY_FAILURE. In all cases, error messages are loaded in final parameter $logs passed by reference.

Parameters

string $name
array $parameters
int $flag One of the class constants flags
array $logs Passed by reference

Return Value

object

at line 67
public null|string findBuilder(string $name, int $flag = self::ERROR_ON_FAILURE, array $logs = array())

Find the object builder class following current factory settings

Errors are thrown by default but can be "gracefully" skipped using the flag GRACEFULLY_FAILURE. In all cases, error messages are loaded in final parameter $logs passed by reference.

Parameters

string $name
int $flag One of the class constants flags
array $logs Passed by reference

Return Value

null|string