RavSystem API docs

RoomRepository extends BaseRepository
in package
implements IRoomRepository

Interfaces, Classes, Traits and Enums

IRoomRepository

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
$buildingLoading  : bool
$buildingRepository  : IBuildingRepository
$imageRepository  : IImageRepository
$pagination  : Pagination
__construct()  : mixed
all()  : array<string|int, Model>
reads all results of query
byId()  : Model
Reads specific object by provided id
byIdAndBuildingId()  : Room
search room by id and building 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 room state
setDefaultImage()  : void
Sets default image for room
setPagination()  : IRepository
Sets pagination feature enabled
where()  : IRepository
Builds WHERE clause of query with provided data of array
withBuilding()  : RoomRepositoryInterfave
enable building loading
executeQuery()  : array<string|int, mixed>
newItem()  : Room
Creates new Domain object from provided data

Properties

$SQLorder

protected string $SQLorder = ' ORDER BY `created` DESC'

Methods

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

byIdAndBuildingId()

search room by id and building id

public byIdAndBuildingId(int $roomId, int $buildingId) : Room
Parameters
$roomId : int
$buildingId : int
Return values
Room

create()

{@inheritDoc}

public create(string $name, int $buildingId, string $roomType, int $seatsCount, int $floor) : int
Parameters
$name : string
$buildingId : int
$roomType : string
$seatsCount : int
$floor : int
Return values
int

delete()

Deletes provided object

public delete(Model $object) : void
Parameters
$object : Model
Return values
void

orderBy()

Enables ordering on results

public orderBy(string $name[, string $direction = 'DESC' ]) : IRepository
Parameters
$name : string
$direction : string = 'DESC'
Return values
IRepository

setDefaultImage()

Sets default image for room

public setDefaultImage(Room $room) : void
Parameters
$room : Room
Return values
void

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

withBuilding()

enable building loading

public withBuilding() : RoomRepositoryInterfave
Return values
RoomRepositoryInterfave

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) : Room
Parameters
$data : array<string|int, mixed>
Return values
Room

Search results