PHP Interface gossi\codegen\model\RoutineInterface

Datei anzeigen Open project: gossi/php-code-generator Interface Usage Examples

Public Methods

Method Description
addParameter ( PhpParameter $parameter ) Adds a parameter
addSimpleDescParameter ( string $name, null | string $type = null, null | string $typeDescription = null, mixed $defaultValue = null ) A quick way to add a parameter with description which is created from the given parameters
addSimpleParameter ( string $name, null | string $type = null, mixed $defaultValue = null ) A quick way to add a parameter which is created from the given parameters
getBody ( ) : string Returns the body
getParameter ( string | integer $nameOrIndex ) : PhpParameter Returns a parameter by index or name
getParameters ( ) : array Returns a collection of parameters
hasParameter ( string $name ) : boolean Checks whether a parameter exists
isReferenceReturned ( ) : boolean Returns whether a reference is returned
removeParameter ( integer | string | PhpParameter $param ) Remove a parameter at a given position
replaceParameter ( integer $position, PhpParameter $parameter ) Replaces a parameter at a given position
setBody ( string $body ) Sets the body for this
setParameters ( array $parameters ) Sets a collection of parameters
setReferenceReturned ( boolean $bool ) Set true if a reference is returned of false if not

Method Details

addParameter() public method

Adds a parameter
public addParameter ( PhpParameter $parameter )
$parameter PhpParameter

addSimpleDescParameter() public method

A quick way to add a parameter with description which is created from the given parameters
public addSimpleDescParameter ( string $name, null | string $type = null, null | string $typeDescription = null, mixed $defaultValue = null )
$name string
$type null | string
$typeDescription null | string
$defaultValue mixed omit the argument to define no default value

addSimpleParameter() public method

A quick way to add a parameter which is created from the given parameters
public addSimpleParameter ( string $name, null | string $type = null, mixed $defaultValue = null )
$name string
$type null | string
$defaultValue mixed omit the argument to define no default value

getBody() public method

Returns the body
public getBody ( ) : string
return string

getParameter() public method

Returns a parameter by index or name
public getParameter ( string | integer $nameOrIndex ) : PhpParameter
$nameOrIndex string | integer
return PhpParameter

getParameters() public method

Returns a collection of parameters
public getParameters ( ) : array
return array

hasParameter() public method

Checks whether a parameter exists
public hasParameter ( string $name ) : boolean
$name string parameter name
return boolean `true` if a parameter exists and `false` if not

isReferenceReturned() public method

Returns whether a reference is returned
public isReferenceReturned ( ) : boolean
return boolean

removeParameter() public method

Remove a parameter at a given position
public removeParameter ( integer | string | PhpParameter $param )
$param integer | string | PhpParameter

replaceParameter() public method

Replaces a parameter at a given position
public replaceParameter ( integer $position, PhpParameter $parameter )
$position integer
$parameter PhpParameter

setBody() public method

Sets the body for this
public setBody ( string $body )
$body string

setParameters() public method

Note: clears all parameters before setting the new ones
public setParameters ( array $parameters )
$parameters array

setReferenceReturned() public method

Set true if a reference is returned of false if not
public setReferenceReturned ( boolean $bool )
$bool boolean