PHP Trait gossi\codegen\model\parts\ValuePart

For all models that have a value (or expression)
Author: Thomas Gossmann
Datei anzeigen Open project: gossi/php-code-generator

Public Methods

Method Description
getDefaultValue ( ) : mixed
getExpression ( ) : string Returns the expression
getValue ( ) : string | integer | float | boolean | null | PhpConstant Returns the value
hasDefaultValue ( ) : boolean
hasValue ( ) : boolean Checks whether a value or expression is set
isExpression ( ) : boolean Returns whether an expression is set
setDefaultValue ( mixed $value )
setExpression ( string $expr ) Sets an expression
setValue ( string | integer | float | boolean | null | PhpConstant $value ) Sets the value
unsetDefaultValue ( )
unsetExpression ( ) Unsets the expression
unsetValue ( ) Unsets the value

Private Methods

Method Description
isPrimitive ( mixed $value ) : boolean Returns whether the given value is a primitive

Method Details

getDefaultValue() public method

Deprecation: use `getValue()` instead
public getDefaultValue ( ) : mixed
return mixed

getExpression() public method

Returns the expression
public getExpression ( ) : string
return string

getValue() public method

Returns the value
public getValue ( ) : string | integer | float | boolean | null | PhpConstant
return string | integer | float | boolean | null | gossi\codegen\model\PhpConstant

hasDefaultValue() public method

Deprecation: use `hasValue()` instead
public hasDefaultValue ( ) : boolean
return boolean

hasValue() public method

Checks whether a value or expression is set
public hasValue ( ) : boolean
return boolean

isExpression() public method

Returns whether an expression is set
public isExpression ( ) : boolean
return boolean

setDefaultValue() public method

Deprecation: use `setValue()` instead
public setDefaultValue ( mixed $value )
$value mixed

setExpression() public method

Sets an expression
public setExpression ( string $expr )
$expr string

setValue() public method

Sets the value
public setValue ( string | integer | float | boolean | null | PhpConstant $value )
$value string | integer | float | boolean | null | gossi\codegen\model\PhpConstant

unsetDefaultValue() public method

Deprecation: use `unsetValue()` instead
public unsetDefaultValue ( )

unsetExpression() public method

Unsets the expression
public unsetExpression ( )

unsetValue() public method

Unsets the value
public unsetValue ( )