ScaffoldTrait
Trait DescribesTrait
This trait provides methods to describe columns, references, and indexes of a database table.
- Full name:
\Zemit\Modules\Cli\Tasks\Traits\ScaffoldTrait
Properties
namespace
protected ?string $namespace
directory
protected string $directory
srcDirectory
protected string $srcDirectory
testsDirectory
protected string $testsDirectory
enumsDirectory
protected string $enumsDirectory
modelsDirectory
protected string $modelsDirectory
abstractsDirectory
protected string $abstractsDirectory
interfacesDirectory
protected string $interfacesDirectory
controllersDirectory
protected string $controllersDirectory
whitelistedTables
protected ?array $whitelistedTables
excludedTables
protected ?array $excludedTables
licenseStamp
public string $licenseStamp
strictTypes
public string $strictTypes
Methods
getLicenseStamp
Retrieves the license stamp.
public getLicenseStamp(): string|null
Return Value:
The license stamp, or null if there is no license.
getStrictTypes
Retrieves the value of the 'strictTypes' property.
public getStrictTypes(): string|null
Return Value:
The value of the 'strictTypes' property, or null if the 'no-strict-types' parameter is set.
isWhitelistedTable
Checks if the given table is whitelisted.
public isWhitelistedTable(string $table): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$table | string | The table name to check. |
Return Value:
Returns true if the table is whitelisted, false otherwise.
isExcludedTable
Determines if a table is excluded.
public isExcludedTable(string $table): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$table | string | The name of the table to check. |
Return Value:
Returns true if the table is excluded, false otherwise.
isNoControllers
public isNoControllers(): bool
isNoInterfaces
public isNoInterfaces(): bool
isNoAbstracts
public isNoAbstracts(): bool
isNoModels
public isNoModels(): bool
isNoEnums
public isNoEnums(): bool
isNoStrictTypes
public isNoStrictTypes(): bool
isNoLicense
public isNoLicense(): bool
isNoComments
public isNoComments(): bool
isNoGetSetMethods
public isNoGetSetMethods(): bool
isNoValidations
public isNoValidations(): bool
isNoRelationships
public isNoRelationships(): bool
isNoColumnMap
public isNoColumnMap(): bool
isNoSetSource
public isNoSetSource(): bool
isNoTypings
public isNoTypings(): bool
isGranularTypings
public isGranularTypings(): bool
isAddRawValueType
public isAddRawValueType(): bool
isProtectedProperties
public isProtectedProperties(): bool
isAbsolutePath
Determines if a given path is an absolute path.
public isAbsolutePath(string $path = ''): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string | The path to be checked. (default: null) |
Return Value:
Returns true if the path is an absolute path, false otherwise.
absolutePathOr
Retrieves the absolute file or directory path.
public absolutePathOr(string $path = '', string $fullPath = ''): string
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string | The relative or absolute path to the file or directory. |
$fullPath | string | The full path including directory for the file or directory. |
Return Value:
The absolute file or directory path. If the given path is absolute, it will be returned as is. Otherwise, the full path including directory will be returned.
getDirectory
Retrieves the directory path for a given file or directory path.
public getDirectory(string $path = ''): string
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string | The relative or absolute path to the file or directory. |
Return Value:
The absolute directory path for the given file or directory path.
getSrcDirectory
public getSrcDirectory(string $path = ''): string
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string |
getTestsDirectory
public getTestsDirectory(string $path = ''): string
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string |
getControllersDirectory
public getControllersDirectory(string $path = ''): string
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string |
getModelsDirectory
public getModelsDirectory(string $path = ''): string
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string |
getModelsInterfacesDirectory
public getModelsInterfacesDirectory(string $path = ''): string
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string |
getAbstractsDirectory
public getAbstractsDirectory(string $path = ''): string
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string |
getAbstractsInterfacesDirectory
public getAbstractsInterfacesDirectory(string $path = ''): string
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string |
getModelsTestsDirectory
public getModelsTestsDirectory(string $path = ''): string
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string |
getNamespaceFromPath
Converts a file system path to a PHP namespace.
public getNamespaceFromPath(string $path): string
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string | The file system path to be converted. |
Return Value:
The converted PHP namespace.
getNamespace
public getNamespace(): string
getControllersNamespace
public getControllersNamespace(): string
getModelsNamespace
public getModelsNamespace(): string
getAbstractsNamespace
public getAbstractsNamespace(): string
getModelsInterfacesNamespace
public getModelsInterfacesNamespace(): string
getAbstractsInterfacesNamespace
public getAbstractsInterfacesNamespace(): string
getModelsTestsNamespace
public getModelsTestsNamespace(): string