PHP 트레잇 gossi\codegen\model\parts\ParametersPart

For all models that can have parameters
저자: Thomas Gossmann
파일 보기 프로젝트 열기: gossi/php-code-generator

공개 메소드들

메소드 설명
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
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
removeParameter ( integer | string | PhpParameter $param ) Remove a parameter at a given position
replaceParameter ( integer $position, PhpParameter $parameter ) Replaces a parameter at a given position
setParameters ( array $parameters ) Sets a collection of parameters

보호된 메소드들

메소드 설명
generateParamDocblock ( ) Generates docblock for params
getDocblock ( ) : Docblock Returns the docblock

비공개 메소드들

메소드 설명
checkPosition ( $position )
initParameters ( )
removeParameterByName ( $name )
removeParameterByPosition ( $position )

메소드 상세

addParameter() 공개 메소드

Adds a parameter
public addParameter ( PhpParameter $parameter )
$parameter gossi\codegen\model\PhpParameter

addSimpleDescParameter() 공개 메소드

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() 공개 메소드

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

generateParamDocblock() 보호된 메소드

Generates docblock for params
protected generateParamDocblock ( )

getDocblock() 추상적인 보호된 메소드

Returns the docblock
abstract protected getDocblock ( ) : Docblock
리턴 Docblock

getParameter() 공개 메소드

Returns a parameter by index or name
public getParameter ( string | integer $nameOrIndex ) : PhpParameter
$nameOrIndex string | integer
리턴 gossi\codegen\model\PhpParameter

getParameters() 공개 메소드

Returns a collection of parameters
public getParameters ( ) : array
리턴 array

hasParameter() 공개 메소드

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

removeParameter() 공개 메소드

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

replaceParameter() 공개 메소드

Replaces a parameter at a given position
public replaceParameter ( integer $position, PhpParameter $parameter )
$position integer
$parameter gossi\codegen\model\PhpParameter

setParameters() 공개 메소드

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