Zend Framework
3.0
|
Public Member Functions | |
addUse ($use, $useAlias=null) | |
Add a class to "use" classes. | |
getUses () | |
Returns the "use" classes. | |
addTrait ($trait) | |
Add trait takes an array of trait options or string as arguments. | |
addTraits (array $traits) | |
Add multiple traits. | |
hasTrait ($traitName) | |
Check to see if the class has a trait defined. | |
getTraits () | |
Get a list of trait names. | |
removeTrait ($traitName) | |
Remove a trait by its name. | |
addTraitAlias ($method, $alias, $visibility=null) | |
Add a trait alias. | |
getTraitAliases () | |
addTraitOverride ($method, $traitsToReplace) | |
Add a trait method override. | |
removeTraitOverride ($method, $overridesToRemove=null) | |
Remove an override for a given trait::method. | |
getTraitOverrides () | |
Return trait overrides. | |
addTrait | ( | $trait | ) |
Add trait takes an array of trait options or string as arguments.
Array Format: key: traitName value: String
key: aliases value: array of arrays key: method value:
key: insteadof value: array of arrays key: method value:
mixed | $trait | String | Array |
addTraitAlias | ( | $method, | |
$alias, | |||
$visibility = null |
|||
) |
Add a trait alias.
This will be used to generate the AS portion of the use statement.
$method: This method provides 2 ways for defining the trait method. Option 1: String Option 2: Array key: traitName value: name of trait key: method value: trait method
$alias: Alias is a string representing the new method name.
$visibilty: ReflectionMethod::IS_PUBLIC | ReflectionMethod::IS_PRIVATE| ReflectionMethod::IS_PROTECTED
mixed | $method | String or Array |
string | $alias | |
int | $visiblity |
addTraitOverride | ( | $method, | |
$traitsToReplace | |||
) |
Add a trait method override.
This will be used to generate the INSTEADOF portion of the use statement.
$method: This method provides 2 ways for defining the trait method. Option 1: String Format: <trait name>="">::<method name>=""> Option 2: Array key: traitName value: trait name key: method value: method name
$traitToReplace: The name of the trait that you wish to supersede.
This method provides 2 ways for defining the trait method. Option 1: String of trait to replace Option 2: Array of strings of traits to replace
mixed | $method | |
mixed | $traitToReplace |
addTraits | ( | array | $traits | ) |
Add multiple traits.
Trait can be an array of trait names or array of trait configurations
array | $traitName | Array of string names or configurations ( |
addUse | ( | $use, | |
$useAlias = null |
|||
) |
Add a class to "use" classes.
string | $use | |
string | null | $useAlias |
getTraitAliases | ( | ) |
getTraitOverrides | ( | ) |
Return trait overrides.
getTraits | ( | ) |
Get a list of trait names.
getUses | ( | ) |
Returns the "use" classes.
hasTrait | ( | $traitName | ) |
Check to see if the class has a trait defined.
strint | $traitName |
removeTrait | ( | $traitName | ) |
Remove a trait by its name.
$traitName |
removeTraitOverride | ( | $method, | |
$overridesToRemove = null |
|||
) |
Remove an override for a given trait::method.
$method: This method provides 2 ways for defining the trait method. Option 1: String Format: <trait name>="">::<method name>=""> Option 2: Array key: traitName value: trait name key: method value: method name
$overridesToRemove: The name of the trait that you wish to remove.
This method provides 2 ways for defining the trait method. Option 1: String of trait to replace Option 2: Array of strings of traits to replace
$traitAndMethod | ||
null | $overridesToRemove |