ConstantsPart
Constants part.
For all models that can contain constants
Tags
Table of Contents
- $constants : Map
- clearConstants() : $this
- Clears all constants.
- getConstant() : PhpConstant
- Returns a constant.
- getConstantNames() : Set
- Returns all constant names.
- getConstants() : Map
- Returns all constants.
- hasConstant() : bool
- Checks whether a constant exists.
- hasConstantByName() : bool
- Checks whether a constant exists.
- removeConstant() : $this
- Removes a constant.
- removeConstantByName() : $this
- Removes a constant.
- setConstant() : $this
- Add a PhpConstant object.
- setConstantByName() : $this
- Create a PhpConstant instance and adds it to the constants Map.
- setConstants() : $this
- Sets a collection of constants.
- initConstants() : void
Properties
$constants
private
Map
$constants
Methods
clearConstants()
Clears all constants.
public
clearConstants() : $this
Return values
$this —getConstant()
Returns a constant.
public
getConstant(string $name) : PhpConstant
Parameters
- $name : string
-
constant name
Tags
Return values
PhpConstant —getConstantNames()
Returns all constant names.
public
getConstantNames() : Set
Return values
Set —getConstants()
Returns all constants.
public
getConstants() : Map
Return values
Map —hasConstant()
Checks whether a constant exists.
public
hasConstant(PhpConstant $constant) : bool
Parameters
- $constant : PhpConstant
Return values
bool —hasConstantByName()
Checks whether a constant exists.
public
hasConstantByName(string $name) : bool
Parameters
- $name : string
-
constant name
Return values
bool —removeConstant()
Removes a constant.
public
removeConstant(PhpConstant $constant) : $this
Parameters
- $constant : PhpConstant
Tags
Return values
$this —removeConstantByName()
Removes a constant.
public
removeConstantByName(string $name) : $this
Parameters
- $name : string
-
constant name
Tags
Return values
$this —setConstant()
Add a PhpConstant object.
public
setConstant(PhpConstant $constant) : $this
Parameters
- $constant : PhpConstant
Return values
$this —setConstantByName()
Create a PhpConstant instance and adds it to the constants Map.
public
setConstantByName(string $name[, mixed $value = null ][, bool $isExpression = false ]) : $this
Parameters
- $name : string
-
constant name
- $value : mixed = null
- $isExpression : bool = false
Return values
$this —setConstants()
Sets a collection of constants.
public
setConstants(array<string|int, mixed>|array<string|int, PhpConstant> $constants) : $this
Parameters
- $constants : array<string|int, mixed>|array<string|int, PhpConstant>
Return values
$this —initConstants()
private
initConstants() : void