v0

Default implementation of model for Hubleto project.

\Hubleto\Framework\Model

Parent class\Hubleto\Framework\Core
Implements \Hubleto\Framework\Interfaces\ModelInterface

Constants

Constant Visibility Type Value
HAS_ONE public 'hasOne'
HAS_MANY public 'hasMany'
HAS_MANY_THROUGH public 'hasManyThrough'
BELONGS_TO public 'belongsTo'

Properties

 

☍ fullName

public string $fullName

Full name of the model. Useful for getModel() function

 

☍ shortName

public string $shortName

Short name of the model. Useful for debugging purposes

 

☍ record

public \Illuminate\Database\Eloquent\Model|\Hubleto\Framework\Interfaces\RecordManagerInterface $record
 

☍ lookupSqlValue

public ?string $lookupSqlValue

SQL-compatible string used to render displayed value of the record when used as a lookup.

 

☍ lookupUrlDetail

public ?string $lookupUrlDetail
 

☍ lookupUrlAdd

public ?string $lookupUrlAdd
 

☍ isJunctionTable

public bool $isJunctionTable

If set to TRUE, the SQL table will not contain the ID autoincrement column

 

☍ sqlEngine

public string $sqlEngine
 

☍ table

public string $table
 

☍ recordManagerClass

public string $recordManagerClass
 

☍ relations

public array $relations
 

☍ junctions

public ?array $junctions
 

☍ columns

protected array $columns
 

☍ isExtendableByCustomColumns

public bool $isExtendableByCustomColumns
 

☍ conversionRelations

public array $conversionRelations
 

☍ permission

public string $permission
 

☍ rolePermissions

public array $rolePermissions

Methods

ƒ __construct

public __construct(): mixed

ƒ initRecordManager

[Description for initRecordManager]

public initRecordManager(): null|object

ƒ isDatabaseConnected

[Description for isDatabaseConnected]

public isDatabaseConnected(): bool

ƒ getConfigFullPath

[Description for getConfigFullPath]

public getConfigFullPath(string $configName): string

Parameters

Parameter Type Description
$configName string

ƒ configAsString

Retrieves value of configuration parameter.

public configAsString(string $configName): void

Parameters

Parameter Type Description
$configName string

ƒ configAsInteger

Retrieves value of configuration parameter.

public configAsInteger(string $configName): void

Parameters

Parameter Type Description
$configName string

ƒ configAsArray

Retrieves value of configuration parameter.

public configAsArray(string $configName): void

Parameters

Parameter Type Description
$configName string

ƒ getSqlCreateTableCommands

[Description for getSqlCreateTableCommands]

public getSqlCreateTableCommands(): array

ƒ createSqlTable

[Description for createSqlTable]

public createSqlTable(): mixed

ƒ install

Installs the first version of the model into SQL database. Automatically creates indexes.

public install(): void

ƒ dropTableIfExists

[Description for dropTableIfExists]

public dropTableIfExists(): \Hubleto\Framework\Model

ƒ createSqlForeignKeys

Create foreign keys for the SQL table. Called when all models are installed.

public createSqlForeignKeys(): void

ƒ getFullTableSqlName

Returns full name of the model's SQL table

public getFullTableSqlName(): string

Return Value

Full name of the model's SQL table

ƒ upgrades

Returns list of available upgrades. This method must be overriden by each model.

public upgrades(): array

Return Value

List of available upgrades. Keys of the array are simple numbers starting from 1.

ƒ hasColumn

[Description for hasColumn]

public hasColumn(string $column): bool

Parameters

Parameter Type Description
$column string

ƒ getColumns

[Description for getColumns]

public getColumns(): array<string,\Hubleto\Framework\Column>

ƒ getColumn

[Description for getColumn]

public getColumn(string $column): \Hubleto\Framework\Interfaces\ColumnInterface

Parameters

Parameter Type Description
$column string

ƒ columnNames

[Description for columnNames]

public columnNames(): array

ƒ indexes

[Description for indexes]

public indexes(array $indexes = []): array

Parameters

Parameter Type Description
$indexes array

ƒ indexNames

[Description for indexNames]

public indexNames(): array

ƒ describeColumns

[Description for describeColumns]

public describeColumns(): array

ƒ describeInput

[Description for describeInput]

public describeInput(string $columnName): \Hubleto\Framework\Description\Input

Parameters

Parameter Type Description
$columnName string

ƒ describeForm

[Description for describeForm]

public describeForm(): \Hubleto\Framework\Description\Form

ƒ describeTable

[Description for describeTable]

public describeTable(): \Hubleto\Framework\Description\Table

ƒ convertRecordsToTree

[Description for convertRecordsToTree]

public convertRecordsToTree(array $records, int $idParent, int $level): array

Parameters

Parameter Type Description
$records array
$idParent int
$level int

ƒ loadTableData

[Description for loadTableData]

public loadTableData(string $fulltextSearch = '', array $columnSearch = [], array $orderBy = [], int $itemsPerPage = 15, int $page, string $dataView = ''): array

Parameters

Parameter Type Description
$fulltextSearch string
$columnSearch array
$orderBy array
$itemsPerPage int
$page int
$dataView string

ƒ diffRecords

[Description for diffRecords]

public diffRecords(array $record1, array $record2): array

Parameters

Parameter Type Description
$record1 array
$record2 array

ƒ getById

[Description for getById]

public getById(int $id): mixed

Parameters

Parameter Type Description
$id int

ƒ getLookupSqlValue

[Description for getLookupSqlValue]

public getLookupSqlValue(string $tableAlias = ''): string

Parameters

Parameter Type Description
$tableAlias string

ƒ getLookupValue

public getLookupValue(array $dataRaw): string

Parameters

Parameter Type Description
$dataRaw array

ƒ encryptPassword

Used to encrypt passowrd to store it securely.

public encryptPassword(string $original): string

Parameters

Parameter Type Description
$original string

ƒ onBeforeCreate

[Description for onBeforeCreate]

public onBeforeCreate(array $record): array

Parameters

Parameter Type Description
$record array

ƒ onBeforeUpdate

[Description for onBeforeUpdate]

public onBeforeUpdate(array $record): array

Parameters

Parameter Type Description
$record array

ƒ onAfterCreate

[Description for onAfterCreate]

public onAfterCreate(array $savedRecord): array

Parameters

Parameter Type Description
$savedRecord array

ƒ onAfterUpdate

[Description for onAfterUpdate]

public onAfterUpdate(array $originalRecord, array $savedRecord): array

Parameters

Parameter Type Description
$originalRecord array
$savedRecord array

ƒ onBeforeDelete

[Description for onBeforeDelete]

public onBeforeDelete(int $id): int

Parameters

Parameter Type Description
$id int

ƒ onAfterDelete

[Description for onAfterDelete]

public onAfterDelete(int $id): int

Parameters

Parameter Type Description
$id int

ƒ onAfterLoadRecord

[Description for onAfterLoadRecord]

public onAfterLoadRecord(array $record): array

Parameters

Parameter Type Description
$record array

ƒ onAfterLoadRecords

[Description for onAfterLoadRecords]

public onAfterLoadRecords(array $records): array

Parameters

Parameter Type Description
$records array

Inherited methods

ƒ __construct

public __construct(): mixed

ƒ getServiceStatic

Shortcut for the dependency injection.

public static getServiceStatic(string $service): mixed
Parameter Type Description
$service string

ƒ getService

[Description for getService]

public getService(string $service): mixed

Parameters

Parameter Type Description
$service string

ƒ env

Shortcut for the env service.

public env(): \Hubleto\Framework\Env

ƒ authProvider

Shortcut for the authentication service.

public authProvider(): \Hubleto\Framework\Interfaces\AuthInterface

ƒ db

Shortcut for the database service.

public db(): \Hubleto\Framework\Db

ƒ appManager

Shortcut for the app manager service.

public appManager(): \Hubleto\Framework\Interfaces\AppManagerInterface

ƒ router

Shortcut for the router service.

public router(): \Hubleto\Framework\Router

ƒ hookManager

Shortcut for the hook manager service.

public hookManager(): \Hubleto\Framework\HookManager

ƒ sessionManager

Shortcut for the session manager service.

public sessionManager(): \Hubleto\Framework\SessionManager

ƒ permissionsManager

Shortcut for the permissions manager service.

public permissionsManager(): \Hubleto\Framework\PermissionsManager

ƒ cronManager

Shortcut for the cron manager service.

public cronManager(): \Hubleto\Framework\CronManager

ƒ emailProvider

Shortcut for the email provider service.

public emailProvider(): \Hubleto\Framework\EmailProvider

ƒ config

Shortcut for the config service.

public config(): \Hubleto\Framework\Interfaces\ConfigManagerInterface

ƒ terminal

Shortcut for the terminal service.

public terminal(): \Hubleto\Framework\Interfaces\TerminalInterface

ƒ logger

Shortcut for the logger service.

public logger(): \Hubleto\Framework\Interfaces\LoggerInterface

ƒ locale

Shortcut for the locale service.

public locale(): \Hubleto\Framework\Interfaces\LocaleInterface

ƒ renderer

Shortcut for the renderer service.

public renderer(): \Hubleto\Framework\Interfaces\RendererInterface

ƒ translator

Shortcut for the translator service.

public translator(): \Hubleto\Framework\Interfaces\TranslatorInterface

ƒ getModel

[Description for getModel]

public getModel(string $model): \Hubleto\Framework\Interfaces\ModelInterface

Parameters

Parameter Type Description
$model string

ƒ getController

[Description for getController]

public getController(string $controller): \Hubleto\Framework\Controller

Parameters

Parameter Type Description
$controller string

ƒ translate

public translate(string $string, array<string,string> $vars = [], string $contextInner = ''): string

Parameters

Parameter Type Description
$string string
$vars array<string,string>
$contextInner string
www.hubleto.com | Found a bug or missing something? Report an issue via GitHub.