PHP Trait gossi\codegen\model\parts\ConstantsPart

For all models that can contain constants
Author: Thomas Gossmann
Afficher le fichier Open project: gossi/php-code-generator

Méthodes publiques

Méthode Description
clearConstants ( ) Clears all constants
getConstant ( string | PhpConstant $nameOrConstant ) : PhpConstant Returns a constant.
getConstantNames ( ) : phootwork\collection\Set Returns all constant names
getConstants ( ) : phootwork\collection\Map Returns all constants
hasConstant ( string | PhpConstant $nameOrConstant ) : boolean Checks whether a constant exists
removeConstant ( string | PhpConstant $nameOrConstant ) Removes a constant
setConstant ( string | PhpConstant $nameOrConstant, string $value = null, $isExpression = false ) Adds a constant
setConstants ( array $constants ) Sets a collection of constants

Private Methods

Méthode Description
initConstants ( )

Method Details

clearConstants() public méthode

Clears all constants
public clearConstants ( )

getConstant() public méthode

Returns a constant.
public getConstant ( string | PhpConstant $nameOrConstant ) : PhpConstant
$nameOrConstant string | gossi\codegen\model\PhpConstant
Résultat gossi\codegen\model\PhpConstant

getConstantNames() public méthode

Returns all constant names
public getConstantNames ( ) : phootwork\collection\Set
Résultat phootwork\collection\Set

getConstants() public méthode

Returns all constants
public getConstants ( ) : phootwork\collection\Map
Résultat phootwork\collection\Map

hasConstant() public méthode

Checks whether a constant exists
public hasConstant ( string | PhpConstant $nameOrConstant ) : boolean
$nameOrConstant string | gossi\codegen\model\PhpConstant
Résultat boolean

removeConstant() public méthode

Removes a constant
public removeConstant ( string | PhpConstant $nameOrConstant )
$nameOrConstant string | gossi\codegen\model\PhpConstant constant name

setConstant() public méthode

Adds a constant
public setConstant ( string | PhpConstant $nameOrConstant, string $value = null, $isExpression = false )
$nameOrConstant string | gossi\codegen\model\PhpConstant constant name or instance
$value string

setConstants() public méthode

Sets a collection of constants
public setConstants ( array $constants )
$constants array