RavSystem API docs

UserRepository extends BaseRepository
in package
implements IUserRepository

Interfaces, Classes, Traits and Enums

IUserRepository

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
$accessLoading  : bool
$accessRepository  : IAccessRepository
$imageRepository  : IImageRepository
$pagination  : Pagination
__construct()  : mixed
all()  : array<string|int, Model>
reads all results of query
byId()  : Model
Reads specific object by provided id
delete()  : void
If used twice on same user, will casuse permanently deletion of the user and all resources related to it.
one()  : Model
gets one item from collection
orderBy()  : IRepository
Enables ordering on results
register()  : int
Creates new User account
registerActivity()  : void
Register activity for user with specified userId
save()  : void
saves state of the user
search()  : UserRepository
search for a users with given phrase by name, surname, and email
setDefaultImage()  : void
sets default image for user
setPagination()  : IRepository
Sets pagination feature enabled
where()  : IRepository
Builds WHERE clause of query with provided data of array
withAccess()  : IUserRepository
enables loading of user access properties
executeQuery()  : array<string|int, mixed>
newItem()  : User
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

delete()

If used twice on same user, will casuse permanently deletion of the user and all resources related to it.

public delete(User $user) : void

Sets default iamge to the user and deletes used previously

Parameters
$user : User
Tags
throws
DefaultUserDeleteException
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

register()

Creates new User account

public register(string $name, string $surname, string $email, string $password) : int
Parameters
$name : string
$surname : string
$email : string
$password : string
Return values
int

registerActivity()

Register activity for user with specified userId

public registerActivity(int $userId) : void
Parameters
$userId : int
Return values
void

save()

saves state of the user

public save(User $user) : void
Parameters
$user : User
Return values
void

setDefaultImage()

sets default image for user

public setDefaultImage(User $user) : void
Parameters
$user : User
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

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

Search results