Arikaim CMS

Language extends Model
in package
Uses Uuid, Find, Status, DefaultTrait, Position

Language database model

Table of Contents

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_STATUS_COLUMN  : string
Default status column name
$DEFAULT_UUID_COLUMN  : string
Default uuid column name
$fillable  : array<string|int, mixed>
Fillable attributes
$statusText  : array<string|int, mixed>
Status text
$table  : string
Db table name

Methods

ACTIVE()  : int
Return active value
add()  : Model|bool
Add language record
bootPosition()  : void
Init model events
bootUuid()  : void
Init model events.
CANCELLED()  : int
Cancelled
COMPLETED()  : int
Return completed value
DISABLED()  : int
Return disabled value
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
findLanguage()  : object|null
Find language by code
findMultiple()  : Builder
Find multiole query
findQuery()  : Builder
Return query builder
getActive()  : Builder
Return active model query builder
getDefault()  : Model|null
Get default model
getDefaultAttribute()  : bool
Mutator (get) for default attribute.
getDefaultColumnName()  : string
Get default column name
getDefaultKeyColumnName()  : string
Get default key column name
getDefaultLanguage()  : string
Return default language
getDisabled()  : Builder
Return disabled model query builder
getIdAttributeName()  : string
Return id column name dependiv of id value type for string return uuid
getLanguages()  : void
Gte languages by codes
getLastId()  : int|null
Get last id
getLastRow()  : Model|null
Get last row
getMaxPosition()  : Model
Get model with max position
has()  : bool
Return true if language exist
hasAttribute()  : bool
Return true if atr exist
hasDefault()  : bool
Return true if default value is set
moveFirst()  : Model
Move to first position
moveLast()  : Model
Move to last position
PENDING()  : int
Pending activation
resolveStatusText()  : int|false
Resolve status id
resolveStatusValue()  : int
Get status value
scopeActiveQuery()  : Builder
Active status scope
scopeDefaultQuery()  : Builder
Default scope
scopeSearchIgnoreCase()  : Builder
Case insensitive search
scopeStatusQuery()  : Builder
Status scope
setCodeAttribute()  : void
Mutator (set) for code attribute.
setDefault()  : bool
Set model as default
setStatus()  : bool
Set model status
shiftPosition()  : Model
Shift position up or down
SUSPENDED()  : int
Suspended
swapPosition()  : object
Swap positions
whereIgnoreCase()  : Builder
Where case insensitive
getPositionAttributeName()  : string
Get position column name
setLastPosition()  : Model
Set model position value

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_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', 'code', 'title', 'native_title', 'code_3', 'country_code']

$statusText

Status text

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

$table

Db table name

protected string $table = 'language'

Methods

ACTIVE()

Return active value

public ACTIVE() : int
Return values
int

add()

Add language record

public add(array<string|int, mixed> $language) : Model|bool
Parameters
$language : array<string|int, mixed>
Return values
Model|bool

bootPosition()

Init model events

public static bootPosition() : void

bootUuid()

Init model events.

public static bootUuid() : void

CANCELLED()

Cancelled

public CANCELLED() : int
Return values
int

COMPLETED()

Return completed value

public COMPLETED() : int
Return values
int

DISABLED()

Return disabled value

public DISABLED() : int
Return values
int

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

findLanguage()

Find language by code

public findLanguage(string $code) : object|null
Parameters
$code : string
Return values
object|null

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

getActive()

Return active model query builder

public getActive() : Builder
Return values
Builder

getDefault()

Get default model

public getDefault([mixed|null $keyValue = null ]) : Model|null
Parameters
$keyValue : mixed|null = null
Return values
Model|null

getDefaultAttribute()

Mutator (get) for default attribute.

public getDefaultAttribute() : bool
Return values
bool

getDefaultColumnName()

Get default column name

public getDefaultColumnName() : string
Return values
string

getDefaultKeyColumnName()

Get default key column name

public getDefaultKeyColumnName() : string
Return values
string

getDefaultLanguage()

Return default language

public getDefaultLanguage() : string
Return values
string

getDisabled()

Return disabled model query builder

public getDisabled() : Builder
Return values
Builder

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

getLanguages()

Gte languages by codes

public getLanguages(array<string|int, mixed> $codes) : void
Parameters
$codes : array<string|int, mixed>

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

getMaxPosition()

Get model with max position

public getMaxPosition() : Model
Return values
Model

has()

Return true if language exist

public has(string $code[, int $status = null ]) : bool
Parameters
$code : string
$status : int = null
Return values
bool

hasAttribute()

Return true if atr exist

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

hasDefault()

Return true if default value is set

public hasDefault([mixed|null $keyValue = null ]) : bool
Parameters
$keyValue : mixed|null = null
Return values
bool

moveFirst()

Move to first position

public moveFirst() : Model
Return values
Model

moveLast()

Move to last position

public moveLast() : Model
Return values
Model

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

scopeActiveQuery()

Active status scope

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

scopeDefaultQuery()

Default scope

public scopeDefaultQuery(Builder $query[, mixed|null $keyValue = null ]) : Builder
Parameters
$query : Builder
$keyValue : mixed|null = null
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

setCodeAttribute()

Mutator (set) for code attribute.

public setCodeAttribute(string $value) : void
Parameters
$value : string

setDefault()

Set model as default

public setDefault([int|string|null $id = null ][, int|null $keyValue = null ]) : bool
Parameters
$id : int|string|null = null
$keyValue : int|null = null
Return values
bool

setStatus()

Set model status

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

shiftPosition()

Shift position up or down

public shiftPosition(Model $target) : Model
Parameters
$target : Model
Return values
Model

SUSPENDED()

Suspended

public SUSPENDED() : int
Return values
int

swapPosition()

Swap positions

public swapPosition(Model $model) : object
Parameters
$model : Model
Return values
object

whereIgnoreCase()

Where case insensitive

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

getPositionAttributeName()

Get position column name

protected getPositionAttributeName() : string
Return values
string

setLastPosition()

Set model position value

private static setLastPosition(Model $model) : Model
Parameters
$model : Model
Return values
Model

        
On this page

Search results