PermissionsSchema
extends Schema
in package
Permissions database table schema definition.
Table of Contents
Properties
- $descriptor : object|null
- Descriptor instance
- $descriptorClass : null|string
- Descriptor class
- $storageEngine : string
- Db storage engine
- $tableName : string
- Db table name
Methods
- __construct() : mixed
- Constructor
- build() : void
- Execute blueprint.
- create() : void
- Create table
- createTable() : void
- Create table
- descriptor() : object|null
- Get descriptor
- dropIndex() : bool
- Drop table index
- dropTable() : bool
- Drop table
- getColumnType() : string
- Get column type
- getDescriptor() : array<string|int, mixed>
- Get descriptor
- getQuery() : QueryBuilder
- Get query builder for table
- getSkipedImportColumns() : string
- Return list with skipped column names which are not included in import
- getTable() : bool|string
- Return model table name
- getTableName() : string
- Return table name
- hasColumn() : bool
- Check if table column exists.
- hasIndex() : bool
- Return true if index exist
- hasTable() : bool
- Check if database exist.
- install() : bool
- Run Create and Update migration
- isEmpty() : bool
- Return true if table is empty
- runSeeds() : mixed|false
- Execute seeds
- schema() : object
- Return shema object
- seeds() : void
- Insert or update rows in table
- setDescriptorClass() : void
- Set descriptor class
- setRowFormat() : bool
- Changes db table row format
- tableExists() : bool
- Checkif table exist
- unInstall() : bool
- UnInstall migration
- update() : void
- Update table
- updateTable() : void
- Update table
- initDescriptor() : void
- Init descriptor properties
Properties
$descriptor
Descriptor instance
protected
object|null
$descriptor
= null
$descriptorClass
Descriptor class
protected
null|string
$descriptorClass
= null
$storageEngine
Db storage engine
protected
string
$storageEngine
= 'InnoDB row_format=dynamic'
$tableName
Db table name
protected
string
$tableName
= 'permissions'
Methods
__construct()
Constructor
public
__construct() : mixed
build()
Execute blueprint.
public
build(TableBlueprint $blueprint, Builder $builder) : void
Parameters
- $blueprint : TableBlueprint
- $builder : Builder
create()
Create table
public
create(TableBlueprint $table) : void
Parameters
- $table : TableBlueprint
createTable()
Create table
public
createTable() : void
descriptor()
Get descriptor
public
descriptor() : object|null
Return values
object|nulldropIndex()
Drop table index
public
dropIndex(string $indexName) : bool
Parameters
- $indexName : string
Return values
booldropTable()
Drop table
public
dropTable([bool $emptyOnly = true ]) : bool
Parameters
- $emptyOnly : bool = true
Return values
boolgetColumnType()
Get column type
public
getColumnType(string $columnName) : string
Parameters
- $columnName : string
Return values
stringgetDescriptor()
Get descriptor
public
getDescriptor() : array<string|int, mixed>
Return values
array<string|int, mixed>getQuery()
Get query builder for table
public
static getQuery(string $tableName) : QueryBuilder
Parameters
- $tableName : string
Return values
QueryBuildergetSkipedImportColumns()
Return list with skipped column names which are not included in import
public
getSkipedImportColumns() : string
Return values
stringgetTable()
Return model table name
public
static getTable(string $class) : bool|string
Parameters
- $class : string
-
Model class name
Return values
bool|stringgetTableName()
Return table name
public
getTableName() : string
Return values
stringhasColumn()
Check if table column exists.
public
hasColumn(string $column) : bool
Parameters
- $column : string
Return values
boolhasIndex()
Return true if index exist
public
hasIndex(string $indexName) : bool
Parameters
- $indexName : string
Return values
boolhasTable()
Check if database exist.
public
static hasTable(object|string $model) : bool
Parameters
- $model : object|string
-
Table name or db model object
Return values
boolinstall()
Run Create and Update migration
public
static install(string $class[, string $extension = null ]) : bool
Parameters
- $class : string
- $extension : string = null
Return values
boolisEmpty()
Return true if table is empty
public
isEmpty() : bool
Return values
boolrunSeeds()
Execute seeds
public
runSeeds() : mixed|false
Return values
mixed|falseschema()
Return shema object
public
static schema() : object
Return values
objectseeds()
Insert or update rows in table
public
seeds(Seed $seed) : void
Parameters
- $seed : Seed
setDescriptorClass()
Set descriptor class
public
setDescriptorClass(string $class) : void
Parameters
- $class : string
setRowFormat()
Changes db table row format
public
static setRowFormat(string $table[, string $format = 'DYNAMIC' ]) : bool
Parameters
- $table : string
- $format : string = 'DYNAMIC'
Return values
booltableExists()
Checkif table exist
public
tableExists() : bool
Return values
boolunInstall()
UnInstall migration
public
static unInstall(string $class[, string $extension = null ][, bool $force = false ]) : bool
Parameters
- $class : string
- $extension : string = null
- $force : bool = false
-
Set to true will drop table if have rows.
Return values
boolupdate()
Update table
public
update(TableBlueprint $table) : void
Parameters
- $table : TableBlueprint
updateTable()
Update table
public
updateTable() : void
initDescriptor()
Init descriptor properties
protected
initDescriptor() : void