Menu

## Service extends CodeGenerator
in package

Service.php : 16

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

#### $name

CodeGenerator.php : 13
`protected string $name`

#### $output

CodeGenerator.php : 14
`protected OutputInterface|null $output = null`

#### $actions

Service.php : 20
`private array<string|int, mixed>|null $actions`

#### $backupName

Service.php : 22
`private string|null $backupName = null`

#### $defaults

Service.php : 24
`private array<string|int, mixed> $defaults = ['get', 'create', 'list', 'delete']`

#### $dir

Service.php : 18
`private string $dir = BASEPATH . '/app/services/'`

#### $namespace

Service.php : 19
`private string $namespace = 'application\\services'`

#### $serviceType

Service.php : 30
`private string|null $serviceType`

#### $targetTable

Service.php : 31
`private string|null $targetTable`

### Methods

#### __construct()

Service.php : 33
`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()

Service.php : 49
`public generate([string|null $className = null ][, SymfonyStyle|null $io = null ]) : void`

##### Parameters

$className : string|null = null
$io : SymfonyStyle|null = null

#### createFile()

CodeGenerator.php : 48
`protected createFile(string $filename, string $content) : void`

##### Parameters

$filename : string
$content : string

#### getOrCreateDirectory()

CodeGenerator.php : 40
`protected getOrCreateDirectory(string $directory) : string`

##### Parameters

$directory : string

##### Return values

string

#### log()

CodeGenerator.php : 31
`protected log(string $message) : void`

##### Parameters

$message : string

#### sweetName()

CodeGenerator.php : 21

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

`protected sweetName(string $type) : string`

##### Parameters

$type : string

##### Return values

string

#### addActions()

Service.php : 99
`private addActions(ClassType $class) : void`

##### Parameters

$class : ClassType

#### createActionMethod()

Service.php : 111
`private createActionMethod(ClassType $class, string $action) : ClassType`

##### Parameters

$class : ClassType
$action : string

##### Return values

ClassType

## Search results