Default implementation of model for Hubleto project.
\Hubleto\Framework\Models\User
| Parent class | \Hubleto\Framework\Model |
Constants
| Constant | Visibility | Type | Value |
|---|---|---|---|
TOKEN_TYPE_USER_FORGOT_PASSWORD |
public | 551155 |
Properties
☍ table
public string $table
☍ hidden
protected $hidden
☍ urlBase
public string $urlBase
☍ lookupSqlValue
public ?string $lookupSqlValue
SQL-compatible string used to render displayed value of the record when used as a lookup.
☍ recordManagerClass
public string $recordManagerClass
☍ junctions
public ?array $junctions
Methods
ƒ __construct
public __construct(): mixed
ƒ describeColumns
[Description for describeColumns]
public describeColumns(): array
ƒ describeTable
[Description for describeTable]
public describeTable(): \Hubleto\Framework\Description\Table
ƒ indexes
[Description for indexes]
public indexes(array $indexes = []): array
Parameters
| Parameter | Type | Description |
|---|---|---|
$indexes |
array |
ƒ getClientIpAddress
[Description for getClientIpAddress]
public getClientIpAddress(): string
ƒ updateAccessInformation
[Description for updateAccessInformation]
public updateAccessInformation(int $idUser): void
Parameters
| Parameter | Type | Description |
|---|---|---|
$idUser |
int |
ƒ updateLoginAndAccessInformation
[Description for updateLoginAndAccessInformation]
public updateLoginAndAccessInformation(int $idUser): void
Parameters
| Parameter | Type | Description |
|---|---|---|
$idUser |
int |
ƒ isUserActive
[Description for isUserActive]
public isUserActive(mixed $user): bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$user |
mixed |
ƒ authCookieGetLogin
[Description for authCookieGetLogin]
public authCookieGetLogin(): string
ƒ authCookieSerialize
[Description for authCookieSerialize]
public authCookieSerialize(mixed $login, mixed $password): string
Parameters
| Parameter | Type | Description |
|---|---|---|
$login |
mixed | |
$password |
mixed |
ƒ generateToken
[Description for generateToken]
public generateToken(mixed $idUser, mixed $tokenSalt, mixed $tokenType): string
Parameters
| Parameter | Type | Description |
|---|---|---|
$idUser |
mixed | |
$tokenSalt |
mixed | |
$tokenType |
mixed |
ƒ generatePasswordResetToken
[Description for generatePasswordResetToken]
public generatePasswordResetToken(mixed $idUser, mixed $tokenSalt): string
Parameters
| Parameter | Type | Description |
|---|---|---|
$idUser |
mixed | |
$tokenSalt |
mixed |
ƒ validateToken
[Description for validateToken]
public validateToken(mixed $token, bool $deleteAfterValidation = true): array
Parameters
| Parameter | Type | Description |
|---|---|---|
$token |
mixed | |
$deleteAfterValidation |
bool |
ƒ getQueryForUser
[Description for getQueryForUser]
public getQueryForUser(int $idUser): mixed
Parameters
| Parameter | Type | Description |
|---|---|---|
$idUser |
int |
ƒ loadUser
[Description for loadUser]
public loadUser(int $idUser): array
Parameters
| Parameter | Type | Description |
|---|---|---|
$idUser |
int |
ƒ getByEmail
[Description for getByEmail]
public getByEmail(string $email): array
Parameters
| Parameter | Type | Description |
|---|---|---|
$email |
string |
ƒ encryptPassword
[Description for encryptPassword]
public encryptPassword(string $password): string
Parameters
| Parameter | Type | Description |
|---|---|---|
$password |
string |
ƒ updatePassword
[Description for updatePassword]
public updatePassword(int $idUser, string $password): mixed
Parameters
| Parameter | Type | Description |
|---|---|---|
$idUser |
int | |
$password |
string |
Inherited methods
ƒ __construct
public __construct(): mixed
ƒ getServiceStatic
Shortcut for the dependency injection.
public static getServiceStatic(string $service): mixed
- This method is static.
Parameters
| 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 |
ƒ 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 |
