AccessRepository
extends BaseRepository
in package
implements
IAccessRepository
Interfaces, Classes, Traits and Enums
Table of Contents
- $cache : RepositoryCache
- $configTable : string
- $db : IDatabase
- $params : array<string|int, mixed>
- $SQL : string
- $sql : string
- SQL statement
- $SQLlimit : string
- $SQLorder : string
- $SQLwhere : string
- $table : string
- Database table name
- $config : IConfigurationRepository
- $pagination : Pagination
- __construct() : mixed
- all() : array<string|int, Model>
- reads all results of query
- byId() : Model
- Reads specific object by provided id
- create() : int
- {@inheritDoc}
- delete() : void
- Deletes provided object
- one() : Model
- gets one item from collection
- orderBy() : IRepository
- Enables ordering on results
- save() : void
- Saves access calss state
- setPagination() : IRepository
- Sets pagination feature enabled
- where() : IRepository
- Builds WHERE clause of query with provided data of array
- executeQuery() : array<string|int, mixed>
- newItem() : Access
- Creates new Domain object from provided data
Properties
$cache
protected
RepositoryCache
$cache
$configTable
protected
string
$configTable
= '`configuration`'
$db
protected
IDatabase
$db
$params
protected
array<string|int, mixed>
$params
= []
$SQL
protected
string
$SQL
$sql
SQL statement
protected
string
$sql
= ' '
$SQLlimit
protected
string
$SQLlimit
= ''
$SQLorder
protected
string
$SQLorder
= ' ORDER BY `created` DESC'
$SQLwhere
protected
string
$SQLwhere
= ' WHERE 1=1'
$table
Database table name
protected
string
$table
= '`access`'
$config
private
IConfigurationRepository
$config
$pagination
private
Pagination
$pagination
Methods
__construct()
public
__construct(ContainerInterface $di, IConfigurationRepository $config) : mixed
Parameters
- $di : ContainerInterface
- $config : IConfigurationRepository
Return values
mixed —all()
reads all results of query
public
all() : array<string|int, Model>
Return values
array<string|int, Model> —byId()
Reads specific object by provided id
public
byId(int $id) : Model
Parameters
- $id : int
Return values
Model —create()
{@inheritDoc}
public
create(string $name, bool $owner, bool $accessAdmin, bool $premisesAdmin, bool $keysAdmin, bool $reservationsAdmin, bool $reservationsAbility, bool $logsAdmin, bool $statsViewer) : int
Parameters
- $name : string
- $owner : bool
- $accessAdmin : bool
- $premisesAdmin : bool
- $keysAdmin : bool
- $reservationsAdmin : bool
- $reservationsAbility : bool
- $logsAdmin : bool
- $statsViewer : bool
Return values
int —delete()
Deletes provided object
public
delete(Model $access) : void
Parameters
- $access : Model
Tags
Return values
void —one()
gets one item from collection
public
one() : Model
Return values
Model —orderBy()
Enables ordering on results
public
orderBy(string $name[, string $direction = 'DESC' ]) : IRepository
Parameters
- $name : string
- $direction : string = 'DESC'
Return values
IRepository —save()
Saves access calss state
public
save(Access $access) : void
Parameters
- $access : Access
Return values
void —setPagination()
Sets pagination feature enabled
public
setPagination(Pagination &$pagination) : IRepository
Parameters
- $pagination : Pagination
Return values
IRepository —where()
Builds WHERE clause of query with provided data of array
public
where(array<string|int, mixed> $searchParams) : IRepository
Parameters
- $searchParams : array<string|int, mixed>
Return values
IRepository —executeQuery()
protected
executeQuery() : array<string|int, mixed>
Return values
array<string|int, mixed> —newItem()
Creates new Domain object from provided data
protected
newItem(array<string|int, mixed> $data) : Access
Parameters
- $data : array<string|int, mixed>