Arikaim CMS

Users extends Model
in package
implements UserProviderInterface Uses Uuid, Find, Status, DateCreated, SoftDelete, Auth, Password

Users database model

Table of Contents

Interfaces

UserProviderInterface
User auth interface

Properties

$ACTIVE  : mixed
Active
$CANCELLED  : mixed
Cancelled
$COMPLETED  : mixed
Completed
$DISABLED  : mixed
Disabled
$PENDING  : mixed
Pending activation
$PUBLISHED  : mixed
Published
$SUSPENDED  : mixed
Suspended
$timestamps  : bool
Disable timestamps
$DEFAULT_SOFT_DELETE_COLUMN  : string
Default soft delete column mame
$DEFAULT_STATUS_COLUMN  : string
Default status column name
$DEFAULT_UUID_COLUMN  : string
Default uuid column name
$fillable  : array<string|int, mixed>
Fillable attributes
$hidden  : array<string|int, mixed>
Hidden attributes
$statusText  : array<string|int, mixed>
Status text
$table  : string
Db table name

Methods

ACTIVE()  : int
Return active value
bootDateCreated()  : void
Set model events
bootUuid()  : void
Init model events.
CANCELLED()  : int
Cancelled
changePassword()  : bool
Change password
clearDeleted()  : bool
Permanently delete all soft deleted models
COMPLETED()  : int
Return completed value
createUser()  : Model|false
Create user
deleteUser()  : bool
Hard delete user
details()  : Relation|null
User details relation
DISABLED()  : int
Return disabled value
encryptPassword()  : string
Encrypt password
findByColumn()  : Model|null
Find model by column name
findById()  : Model|null
Find model by id or uuid
findByIdQuery()  : Builder
Return query builder
findItems()  : QueryBuilder|false
Find collection of models by id or uuid
findMultiple()  : Builder
Find multiole query
findQuery()  : Builder
Return query builder
findUser()  : Model|null
Find user by username or email
getActive()  : Builder
Return active model query builder
getAuthId()  : mixed
Return auth id
getAuthIdName()  : string
Return Auth id name
getControlPanelUser()  : Model|null
Get user with control panel permission
getDateCreatedAttributeName()  : string
Get date created attribute
getDeletedCount()  : int
Get delete models count.
getDisabled()  : Builder
Return disabled model query builder
getEncryptPasswordAlgo()  : mixed
Return encrypt algo
getIdAttributeName()  : string
Return id column name dependiv of id value type for string return uuid
getLastId()  : int|null
Get last id
getLastRow()  : Model|null
Get last row
getNotDeletedQuery()  : QueryBuilder
Get not deleted query
getPassword()  : string
Get password
getPasswordAttributeName()  : string
Return password attribute name
getUser()  : Model|null
Find user by user name or email
getUserByCredentials()  : array<string|int, mixed>|null
Get user by credentails
getUserById()  : array<string|int, mixed>|null
Return user details by auth id
getUserNameOrEmailAttribute()  : string
Get user_name_or_email attribute
groups()  : Relation
User groups relation
hasAttribute()  : bool
Return true if atr exist
hasControlPanelUser()  : bool
Return true if admin user exist
hasUserEmail()  : bool
Return true if email exist
hasUserName()  : bool
Return true if username exist
isControlPanelUser()  : bool
Return true if user have control panel permission
isDeleted()  : bool
Return true if model is deleted
PENDING()  : int
Pending activation
resolveStatusText()  : int|false
Resolve status id
resolveStatusValue()  : int
Get status value
restore()  : bool
Restore soft deleted models
restoreAll()  : bool
Restore all soft deleted rows
scopeActiveQuery()  : Builder
Active status scope
scopeGetDeleted()  : Builder
Get deleted scope
scopeGetNotDeleted()  : Builder
Get not deleted scope
scopeSearchIgnoreCase()  : Builder
Case insensitive search
scopeStatusQuery()  : Builder
Status scope
setStatus()  : bool
Set model status
softDelete()  : bool
Soft delete model
softDeletedQuery()  : QueryBuilder
Get soft deleted query
SUSPENDED()  : int
Suspended
updateLoginDate()  : bool
Set login date to current time
verifyEmail()  : array<string|int, mixed>|false
Get user by email
verifyPassword()  : bool
Return true if password is correct.
verifyUserName()  : bool
Verify username
whereIgnoreCase()  : Builder
Where case insensitive

Properties

$ACTIVE

Active

public static mixed $ACTIVE = 1

$CANCELLED

Cancelled

public static mixed $CANCELLED = 6

$COMPLETED

Completed

public static mixed $COMPLETED = 2

$DISABLED

Disabled

public static mixed $DISABLED = 0

$PENDING

Pending activation

public static mixed $PENDING = 4

$PUBLISHED

Published

public static mixed $PUBLISHED = 3

$SUSPENDED

Suspended

public static mixed $SUSPENDED = 5

$timestamps

Disable timestamps

public bool $timestamps = false

$DEFAULT_SOFT_DELETE_COLUMN

Default soft delete column mame

protected static string $DEFAULT_SOFT_DELETE_COLUMN = 'date_deleted'

$DEFAULT_STATUS_COLUMN

Default status column name

protected static string $DEFAULT_STATUS_COLUMN = 'status'

$DEFAULT_UUID_COLUMN

Default uuid column name

protected static string $DEFAULT_UUID_COLUMN = 'uuid'

$fillable

Fillable attributes

protected array<string|int, mixed> $fillable = ['uuid', 'user_name', 'email', 'status', 'password', 'date_login', 'date_created', 'date_deleted']

$hidden

Hidden attributes

protected array<string|int, mixed> $hidden = ['password']

$statusText

Status text

protected array<string|int, mixed> $statusText = ['disabled', 'active', 'completed', 'published', 'pending', 'suspended', 'cancelled']

$table

Db table name

protected string $table = 'users'

Methods

ACTIVE()

Return active value

public ACTIVE() : int
Return values
int

bootDateCreated()

Set model events

public static bootDateCreated() : void

bootUuid()

Init model events.

public static bootUuid() : void

CANCELLED()

Cancelled

public CANCELLED() : int
Return values
int

changePassword()

Change password

public changePassword(string|int $id, string $password) : bool
Parameters
$id : string|int
$password : string
Return values
bool

clearDeleted()

Permanently delete all soft deleted models

public clearDeleted() : bool
Return values
bool

COMPLETED()

Return completed value

public COMPLETED() : int
Return values
int

createUser()

Create user

public createUser(string $userName, string $password[, string|null $email = null ]) : Model|false
Parameters
$userName : string
$password : string
$email : string|null = null
Return values
Model|false

deleteUser()

Hard delete user

public deleteUser() : bool
Return values
bool

details()

User details relation

public details() : Relation|null
Return values
Relation|null

DISABLED()

Return disabled value

public DISABLED() : int
Return values
int

encryptPassword()

Encrypt password

public encryptPassword(string $password[, int $algo = null ]) : string
Parameters
$password : string
$algo : int = null
Return values
string

findByColumn()

Find model by column name

public findByColumn(mixed $value[, string|null|array<string|int, mixed> $column = null ]) : Model|null
Parameters
$value : mixed
$column : string|null|array<string|int, mixed> = null
Return values
Model|null

findById()

Find model by id or uuid

public findById(int|string $id) : Model|null
Parameters
$id : int|string
Return values
Model|null

findByIdQuery()

Return query builder

public findByIdQuery(int|string $id) : Builder
Parameters
$id : int|string
Return values
Builder

findItems()

Find collection of models by id or uuid

public findItems(array<string|int, mixed>|null $items) : QueryBuilder|false
Parameters
$items : array<string|int, mixed>|null
Return values
QueryBuilder|false

findMultiple()

Find multiole query

public findMultiple(array<string|int, mixed> $idList) : Builder
Parameters
$idList : array<string|int, mixed>
Return values
Builder

findQuery()

Return query builder

public findQuery(mixed $value[, string|null|array<string|int, mixed> $column = null ]) : Builder
Parameters
$value : mixed
$column : string|null|array<string|int, mixed> = null
Return values
Builder

findUser()

Find user by username or email

public findUser(string $userName) : Model|null
Parameters
$userName : string
Return values
Model|null

getActive()

Return active model query builder

public getActive() : Builder
Return values
Builder

getAuthId()

Return auth id

public getAuthId() : mixed

getAuthIdName()

Return Auth id name

public getAuthIdName() : string
Return values
string

getControlPanelUser()

Get user with control panel permission

public getControlPanelUser() : Model|null
Return values
Model|null

getDateCreatedAttributeName()

Get date created attribute

public getDateCreatedAttributeName() : string
Return values
string

getDeletedCount()

Get delete models count.

public getDeletedCount() : int
Return values
int

getDisabled()

Return disabled model query builder

public getDisabled() : Builder
Return values
Builder

getEncryptPasswordAlgo()

Return encrypt algo

public getEncryptPasswordAlgo() : mixed

getIdAttributeName()

Return id column name dependiv of id value type for string return uuid

public getIdAttributeName(int|string $id) : string
Parameters
$id : int|string
Return values
string

getLastId()

Get last id

public getLastId() : int|null
Return values
int|null

getLastRow()

Get last row

public getLastRow([string $field = 'id' ]) : Model|null
Parameters
$field : string = 'id'
Return values
Model|null

getNotDeletedQuery()

Get not deleted query

public getNotDeletedQuery() : QueryBuilder
Return values
QueryBuilder

getPassword()

Get password

public getPassword() : string
Return values
string

getPasswordAttributeName()

Return password attribute name

public getPasswordAttributeName() : string
Return values
string

getUser()

Find user by user name or email

public getUser(string|null $userName[, string|null $email = null ]) : Model|null
Parameters
$userName : string|null
$email : string|null = null
Return values
Model|null

getUserByCredentials()

Get user by credentails

public getUserByCredentials(array<string|int, mixed> $credentials) : array<string|int, mixed>|null
Parameters
$credentials : array<string|int, mixed>
Return values
array<string|int, mixed>|null

getUserById()

Return user details by auth id

public getUserById(string|int $id) : array<string|int, mixed>|null
Parameters
$id : string|int
Return values
array<string|int, mixed>|null

getUserNameOrEmailAttribute()

Get user_name_or_email attribute

public getUserNameOrEmailAttribute() : string
Return values
string

groups()

User groups relation

public groups() : Relation
Return values
Relation

hasAttribute()

Return true if atr exist

public hasAttribute(string $attr) : bool
Parameters
$attr : string
Return values
bool

hasControlPanelUser()

Return true if admin user exist

public hasControlPanelUser() : bool
Return values
bool

hasUserEmail()

Return true if email exist

public hasUserEmail(string $email) : bool
Parameters
$email : string
Return values
bool

hasUserName()

Return true if username exist

public hasUserName(string $userName) : bool
Parameters
$userName : string
Return values
bool

isControlPanelUser()

Return true if user have control panel permission

public isControlPanelUser([int|null $id = null ]) : bool
Parameters
$id : int|null = null
Return values
bool

isDeleted()

Return true if model is deleted

public isDeleted() : bool
Return values
bool

PENDING()

Pending activation

public PENDING() : int
Return values
int

resolveStatusText()

Resolve status id

public resolveStatusText(string|int $status) : int|false
Parameters
$status : string|int
Return values
int|false

resolveStatusValue()

Get status value

public resolveStatusValue([int|null|string $status = null ]) : int
Parameters
$status : int|null|string = null
Return values
int

restore()

Restore soft deleted models

public restore([mixed $id = null ]) : bool
Parameters
$id : mixed = null
Return values
bool

restoreAll()

Restore all soft deleted rows

public restoreAll() : bool
Return values
bool

scopeActiveQuery()

Active status scope

public scopeActiveQuery(Builder $query) : Builder
Parameters
$query : Builder
Return values
Builder

scopeGetDeleted()

Get deleted scope

public scopeGetDeleted(Builder $query) : Builder
Parameters
$query : Builder
Return values
Builder

scopeGetNotDeleted()

Get not deleted scope

public scopeGetNotDeleted(Builder $query) : Builder
Parameters
$query : Builder
Return values
Builder

scopeSearchIgnoreCase()

Case insensitive search

public scopeSearchIgnoreCase(Builder $query, string $column, string|null $value) : Builder
Parameters
$query : Builder
$column : string
$value : string|null
Return values
Builder

scopeStatusQuery()

Status scope

public scopeStatusQuery(Builder $query, mixed $items) : Builder
Parameters
$query : Builder
$items : mixed
Return values
Builder

setStatus()

Set model status

public setStatus([int|string|null $status = null ]) : bool
Parameters
$status : int|string|null = null
Return values
bool

softDelete()

Soft delete model

public softDelete([mixed $id = null ]) : bool
Parameters
$id : mixed = null
Return values
bool

softDeletedQuery()

Get soft deleted query

public softDeletedQuery() : QueryBuilder
Return values
QueryBuilder

SUSPENDED()

Suspended

public SUSPENDED() : int
Return values
int

updateLoginDate()

Set login date to current time

public updateLoginDate() : bool
Return values
bool

verifyEmail()

Get user by email

public verifyEmail(string $email, int $id) : array<string|int, mixed>|false
Parameters
$email : string
$id : int
Return values
array<string|int, mixed>|false

verifyPassword()

Return true if password is correct.

public verifyPassword(string $password) : bool
Parameters
$password : string
Return values
bool

verifyUserName()

Verify username

public verifyUserName(string $userName, int $id) : bool
Parameters
$userName : string
$id : int
Return values
bool

whereIgnoreCase()

Where case insensitive

public whereIgnoreCase(string $attribute, mixed $value[, string $operator = '=' ]) : Builder
Parameters
$attribute : string
$value : mixed
$operator : string = '='
Return values
Builder

        
On this page

Search results