Documentation

SettingsRepository implements Repository

SettingsRepository

Interfaces, Classes, Traits and Enums

Repository
Repository

Table of Contents

$query  : Builder|null
$scopeDataType  : DataType|null
$scopeOwner  : Model|Authenticatable|null
$scopeSettingType  : SettingType|null
__construct()  : mixed
Repository Constructor.
all()  : SettingsCollection
Get all the Settings.
allOfDataType()  : SettingsCollection
Get all Settings of a SettingType.
allOfSettingType()  : SettingsCollection
Get all Settings of a SettingType.
allRelatedToModel()  : SettingsCollection
Get all Settings related to a Model.
app()  : Repository
Get app scoped repository.
find()  : Setting|null
Find a Setting.
findOrFail()  : Setting
Find a Setting, or fail.
get()  : mixed
Get a Setting's value or the default.
getModel()  : Setting
Get the model.
global()  : Repository
Get global scoped repository.
instance()  : static
New repository instance.
model()  : Repository
Get model scoped repository.
newQuery()  : Builder
New query.
query()  : Builder
Get the current query.
set()  : Setting|null
Set a setting.
user()  : Repository
Get user scoped repository.
where()  : Builder
Where query.
whereOwner()  : Builder
Where the owner is.
filterQuery()  : Builder
Add where clauses to filter the query.
normalizeCollection()  : SettingsCollection
Normalize the Collection to a SettingsCollection.

Properties

Methods

__construct()

Repository Constructor.

public __construct([SettingType|null $scopeSettingType = null ][, Model|Authenticatable|null $scopeOwner = null ][, DataType|null $scopeDataType = null ][, Builder|null $query = null ]) : mixed
Parameters
$scopeSettingType : SettingType|null = null
$scopeOwner : Model|Authenticatable|null = null
$scopeDataType : DataType|null = null
$query : Builder|null = null
Tags
inheritDoc
Return values
mixed

get()

Get a Setting's value or the default.

public get(string $key[, mixed $default = null ]) : mixed
Parameters
$key : string
$default : mixed = null
Tags
inheritDoc
Return values
mixed

global()

Get global scoped repository.

public static global([DataType|null $scopeDataType = null ][, Builder|null $query = null ]) : Repository
Parameters
$scopeDataType : DataType|null = null
$query : Builder|null = null
Tags
inheritDoc
Return values
Repository

instance()

New repository instance.

public static instance([SettingType|null $scopeSettingType = null ][, Model|Authenticatable|null $scopeOwner = null ][, DataType|null $scopeDataType = null ][, Builder|null $query = null ]) : static
Parameters
$scopeSettingType : SettingType|null = null
$scopeOwner : Model|Authenticatable|null = null
$scopeDataType : DataType|null = null
$query : Builder|null = null
Tags
inheritDoc
Return values
static

model()

Get model scoped repository.

public static model(Model $scopeOwner[, DataType|null $scopeDataType = null ][, Builder|null $query = null ]) : Repository
Parameters
$scopeOwner : Model
$scopeDataType : DataType|null = null
$query : Builder|null = null
Tags
inheritDoc
Return values
Repository

newQuery()

New query.

public newQuery() : Builder
Tags
inheritDoc
Return values
Builder

query()

Get the current query.

public query() : Builder
Tags
inheritDoc
Return values
Builder

set()

Set a setting.

public set(string $key, mixed $value[, string|null $description = null ][, SettingType|null $settingType = null ][, DataType|null $dataType = null ][, Model|null $owner = null ]) : Setting|null
Parameters
$key : string
$value : mixed
$description : string|null = null
$settingType : SettingType|null = null
$dataType : DataType|null = null
$owner : Model|null = null
Tags
inheritDoc
Return values
Setting|null

user()

Get user scoped repository.

public static user([Model|Authenticatable|null $scopeUser = null ][, DataType|null $scopeDataType = null ][, Builder|null $query = null ]) : Repository
Parameters
$scopeUser : Model|Authenticatable|null = null
$scopeDataType : DataType|null = null
$query : Builder|null = null
Tags
inheritDoc
Return values
Repository

where()

Where query.

public where(string $field, mixed $operatorOrValue[, mixed $valueOrNull = null ]) : Builder
Parameters
$field : string
$operatorOrValue : mixed
$valueOrNull : mixed = null
Tags
inheritDoc
Return values
Builder

whereOwner()

Where the owner is.

public whereOwner(Model $owner) : Builder
Parameters
$owner : Model
Tags
inheritDoc
Return values
Builder

filterQuery()

Add where clauses to filter the query.

protected filterQuery(Builder $query[, array<string|int, mixed>|SettingType $filterTypes = [] ]) : Builder
Parameters
$query : Builder
$filterTypes : array<string|int, mixed>|SettingType = []
Return values
Builder

normalizeCollection()

Normalize the Collection to a SettingsCollection.

protected normalizeCollection(iteratable<TKey, \Envorra\LaravelSettings\Models\Setting|array> $iterable) : SettingsCollection
Parameters
$iterable : iteratable<TKey, \Envorra\LaravelSettings\Models\Setting|array>
Tags
template

TKey of array-key

Return values
SettingsCollection

Search results