Pionia Core

Service extends CodeGenerator
in package

Code generator for creating new services in Pionia

Table of Contents

Properties

$name  : string
$output  : OutputInterface|null
$actions  : array<string|int, mixed>|null
$backupName  : string|null
$defaults  : array<string|int, mixed>
$dir  : string
$namespace  : string
$serviceType  : string|null
$targetTable  : string|null

Methods

__construct()  : mixed
generate()  : void
createFile()  : void
getOrCreateDirectory()  : string
log()  : void
sweetName()  : string
Spices up the name a little 'user' becomes 'UserService'
addActions()  : void
createActionMethod()  : ClassType

Properties

$actions

private array<string|int, mixed>|null $actions

$backupName

private string|null $backupName = null

$defaults

private array<string|int, mixed> $defaults = ['get', 'create', 'list', 'delete']

$dir

private string $dir = BASEPATH . '/app/services/'

$namespace

private string $namespace = 'application\\services'

$serviceType

private string|null $serviceType

$targetTable

private string|null $targetTable

Methods

__construct()

public __construct(string $name[, array<string|int, mixed>|null $actions = null ][, string|null $targetTable = null ][, string|null $serviceType = null ][, OutputInterface|null $output = null ]) : mixed
Parameters
$name : string
$actions : array<string|int, mixed>|null = null
$targetTable : string|null = null
$serviceType : string|null = null
$output : OutputInterface|null = null

generate()

public generate([string|null $className = null ][, SymfonyStyle|null $io = null ]) : void
Parameters
$className : string|null = null
$io : SymfonyStyle|null = null

createFile()

protected createFile(string $filename, string $content) : void
Parameters
$filename : string
$content : string

getOrCreateDirectory()

protected getOrCreateDirectory(string $directory) : string
Parameters
$directory : string
Return values
string

log()

protected log(string $message) : void
Parameters
$message : string

sweetName()

Spices up the name a little 'user' becomes 'UserService'

protected sweetName(string $type) : string
Parameters
$type : string
Return values
string

addActions()

private addActions(ClassType $class) : void
Parameters
$class : ClassType

createActionMethod()

private createActionMethod(ClassType $class, string $action) : ClassType
Parameters
$class : ClassType
$action : string
Return values
ClassType

        
On this page

Search results