Properties

$rootType

$rootType : 

Type

$itemType

$itemType : 

Type

$compiledTypes

$compiledTypes : 

Type

Methods

__construct()

__construct(string  $rootType, string  $itemType = null) 

Creates new instance

Parameters

string $rootType

the main data model

string $itemType

the list model if is paginated

write()

write(  $className, string  $outputFile) 

Write graphql compiler

Parameters

$className
string $outputFile

_write()

_write(  $className,   $fileName,   $renderCode) : boolean

Write the compiled template in the cache folder.

Throw an exception if it cannot write it.

Parameters

$className
$fileName
$renderCode

Returns

boolean —

Success in writing

createPaginatorType()

createPaginatorType() 

createModelType()

createModelType(string  $type) : string

Parameters

string $type

model name

Returns

string

getNameOf()

getNameOf(  $type) 

Parameters

$type

compileFields()

compileFields(  $model) 

Parameters

$model

compileBasicFields()

compileBasicFields(  $cols) 

Parameters

$cols

compileRelationFields()

compileRelationFields(string  $type, \Pluf_Model  $mainModel) 

Compile and add OneToMany or ManyToMany relations

These relations are created automatically and ther is no related field in the model definitions.

Parameters

string $type

Relation type: 'foreignkey' or 'manytomany'.

\Pluf_Model $mainModel

main model wihch is the target of compile

compileField()

compileField(  $key,   $field) 

Parameters

$key
$field

compileFieldForeignkey()

compileFieldForeignkey(  $key,   $field) 

Parameters

$key
$field

compileFieldManytomany()

compileFieldManytomany(  $key,   $field) 

Parameters

$key
$field

fieldComment()

fieldComment(  $key,   $field) 

Parameters

$key
$field

getRelatedModels()

getRelatedModels(  $model) 

Parameters

$model