PHP 클래스 Iber\Generator\Utilities\SetGetGenerator

파일 보기 프로젝트 열기: ignasbernotas/laravel-model-generator 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$attributes array Lists of attributes to convert
$getStub string Returns a template stub for get function
$setStub string Returns a template stub for set function

공개 메소드들

메소드 설명
__construct ( array $attributes, string $getStub, string $setStub ) [__construct description]
attributeNameToFunction ( string $prefixFunction, string $str, array $noStrip = [] ) : string Converts the given string to function. Support database names (underscores)
createGetFunctionFromAttributeName ( string $attributeName ) : string Bulds the get function for the attribute name
createSetFunctionFromAttributeName ( string $attributeName ) : string Bulds the set function for the attribute name
generateGetFunctions ( ) : string Returns the get functions in string
generateSetFunctions ( ) : string Returns the set functions in string

보호된 메소드들

메소드 설명
createAttributeFunction ( string $stubTemplate, string $function, string $attributeName ) : string Replaces the stub template with the data
createFunctionFromAttributeName ( string $prefixFunction, string $attributeName, string $stubTemplate ) : string Builds the funciton and creates the function from the stub template
generateWithFunction ( string $function ) : string Loops the attributes and build the string with given function name

메소드 상세

__construct() 공개 메소드

[__construct description]
public __construct ( array $attributes, string $getStub, string $setStub )
$attributes array with attributes names
$getStub string set stub template
$setStub string get stub template

attributeNameToFunction() 공개 메소드

Converts the given string to function. Support database names (underscores)
public attributeNameToFunction ( string $prefixFunction, string $str, array $noStrip = [] ) : string
$prefixFunction string desired function prefix (get/set)
$str string attribute name
$noStrip array
리턴 string

createAttributeFunction() 보호된 메소드

Replaces the stub template with the data
protected createAttributeFunction ( string $stubTemplate, string $function, string $attributeName ) : string
$stubTemplate string
$function string
$attributeName string
리턴 string

createFunctionFromAttributeName() 보호된 메소드

Builds the funciton and creates the function from the stub template
protected createFunctionFromAttributeName ( string $prefixFunction, string $attributeName, string $stubTemplate ) : string
$prefixFunction string
$attributeName string
$stubTemplate string
리턴 string

createGetFunctionFromAttributeName() 공개 메소드

Bulds the get function for the attribute name
public createGetFunctionFromAttributeName ( string $attributeName ) : string
$attributeName string
리턴 string

createSetFunctionFromAttributeName() 공개 메소드

Bulds the set function for the attribute name
public createSetFunctionFromAttributeName ( string $attributeName ) : string
$attributeName string
리턴 string

generateGetFunctions() 공개 메소드

Returns the get functions in string
public generateGetFunctions ( ) : string
리턴 string

generateSetFunctions() 공개 메소드

Returns the set functions in string
public generateSetFunctions ( ) : string
리턴 string

generateWithFunction() 보호된 메소드

Loops the attributes and build the string with given function name
protected generateWithFunction ( string $function ) : string
$function string
리턴 string

프로퍼티 상세

$attributes 보호되어 있는 프로퍼티

Lists of attributes to convert
protected array $attributes
리턴 array

$getStub 보호되어 있는 프로퍼티

Returns a template stub for get function
protected string $getStub
리턴 string

$setStub 보호되어 있는 프로퍼티

Returns a template stub for set function
protected string $setStub
리턴 string