RavSystem API docs

ImageRepository extends BaseRepository
in package
implements IImageRepository

Interfaces, Classes, Traits and Enums

IImageRepository

Table of Contents

$cache  : RepositoryCache
$configTable  : string
$configuration  : Configuration
$db  : IDatabase
$params  : array<string|int, mixed>
$SQL  : string
$sql  : string
SQL statement
$SQLlimit  : string
$SQLorder  : string
$SQLwhere  : string
$table  : string
Database table name
$cloudinary  : Cloudinary
$pagination  : Pagination
__construct()  : mixed
all()  : array<string|int, Model>
reads all results of query
byId()  : Model
Reads specific object by provided id
delete()  : void
Delete image if it is not default one {@inheritDoc}
one()  : Model
gets one item from collection
orderBy()  : IRepository
Enables ordering on results
save()  : int
Saves the uploaded image with path identifier
setPagination()  : IRepository
Sets pagination feature enabled
where()  : IRepository
Builds WHERE clause of query with provided data of array
executeQuery()  : array<string|int, mixed>
newItem()  : Image
Creates new Domain object from provided data
deleteFromCloudinary()  : void
deletes image from Cloudinary by public_id
uploadToCloudinary()  : array<string|int, mixed>
Uploads file to the Cloudinary and applies transformation

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()

Delete image if it is not default one {@inheritDoc}

public delete(Image $image) : void
Parameters
$image : Image
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

save()

Saves the uploaded image with path identifier

public save(UploadedFileInterface $file) : int
Parameters
$file : UploadedFileInterface
Tags
throws
ImageSizeExceededException
Return values
int

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

$image

deleteFromCloudinary()

deletes image from Cloudinary by public_id

private deleteFromCloudinary(string $publicId) : void
Parameters
$publicId : string
Return values
void

uploadToCloudinary()

Uploads file to the Cloudinary and applies transformation

private uploadToCloudinary(UploadedFileInterface $file) : array<string|int, mixed>
Parameters
$file : UploadedFileInterface
Return values
array<string|int, mixed>

uploaded file info

Search results