프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$_Dependencies | The property dependancies for the factory. | ||
$_Objects | The object definitions for the factory. |
메소드 | 설명 | |
---|---|---|
__construct ( ) | ||
all ( ) : array | Get all currently defined factories | |
cleanup ( ) | Clean up the factory's objects | |
exists ( string $Alias ) : boolean | Checks whether or not a factory alias exists. | |
factory ( $Alias, $Args = null ) | Creates an object with mapped to the name. | |
install ( string $Alias, string $ClassName, string $Path = '', string $FactoryType = Gdn::FactorySingleton, $Data = null ) | Install a class to the factory. | |
installDependency ( string $Alias, string $PropertyName, string $SourceAlias ) | Install a dependency for the factory. | |
search ( string $search ) : array | Search installed factories by fnmatch | |
uninstall ( string $Alias ) | Uninstall a factory definition. | |
uninstallDependency ( string $Alias, string $PropertyName = null ) | Uninstall a dependency definition. |
메소드 | 설명 | |
---|---|---|
_instantiateObject ( $Alias, string $ClassName, array $Args = null ) | Instantiate a new object. |
메소드 | 설명 | |
---|---|---|
setDependancies ( $Alias, $Object ) |
protected _instantiateObject ( $Alias, string $ClassName, array $Args = null ) | ||
$ClassName | string | The name of the class to instantiate. |
$Args | array | The arguments to pass to the constructor. Note: This function currently only supports a maximum of 8 arguments. |
public factory ( $Alias, $Args = null ) | ||
$Alias | The class code of the object to create. | |
$Args | The arguments to pass to the constructor of the object. |
public install ( string $Alias, string $ClassName, string $Path = '', string $FactoryType = Gdn::FactorySingleton, $Data = null ) | ||
$Alias | string | An alias for the class that will be used to retreive instances of it. |
$ClassName | string | The actual name of the class. |
$Path | string | The path to the class' file. You can prefix the path with ~ to start at the application root (PATH_ROOT). |
$FactoryType | string | The way objects will be instantiated for the class. One of (Gdn::FactoryInstance, Gdn::FactoryPrototype, Gdn::FactorySingleton).
|
public installDependency ( string $Alias, string $PropertyName, string $SourceAlias ) | ||
$Alias | string | The alias of the class that will have the dependency. |
$PropertyName | string | The name of the property on the class that will have the dependency. |
$SourceAlias | string | The alias of the class that will provide the value of the property when objects are instantiated. |
public uninstallDependency ( string $Alias, string $PropertyName = null ) | ||
$Alias | string | The object alias to uninstall the dependency for. |
$PropertyName | string | The name of the property dependency to uninstall. Note: If $PropertyName is null then all of the dependencies will be uninstalled for $Alias. |