Heratio Framework API Reference

Repository
in package

AbstractYes

Base Repository providing Laravel Query Builder interface.

Replaces hardcoded SQL and Propel Criteria with modern, fluent queries.

Tags
author

Johan Pieterse pieterse.johan3@gmail.com

Table of Contents

Methods

all()  : Collection
Get all records from the table.
count()  : int
Count records matching criteria.
create()  : int
Create a new record and return its ID.
delete()  : bool
Delete a record by ID.
exists()  : bool
Check if a record exists.
find()  : array<string|int, mixed>|null
Find a single record by ID.
findWhere()  : Collection
Find all records matching criteria.
getBindings()  : array<int, mixed>
Get bindings for debugging.
paginate()  : array<string|int, mixed>
Find records with pagination support.
toSql()  : string
Get SQL query string for debugging.
update()  : bool
Update a record by ID.

Methods

all()

Get all records from the table.

public all() : Collection
Return values
Collection

count()

Count records matching criteria.

public count([array<string, mixed> $criteria = [] ]) : int
Parameters
$criteria : array<string, mixed> = []
Return values
int

create()

Create a new record and return its ID.

public create(array<string, mixed> $data) : int
Parameters
$data : array<string, mixed>
Return values
int

delete()

Delete a record by ID.

public delete(int $id) : bool
Parameters
$id : int
Return values
bool

exists()

Check if a record exists.

public exists(array<string, mixed> $criteria) : bool
Parameters
$criteria : array<string, mixed>
Return values
bool

find()

Find a single record by ID.

public find(int $id) : array<string|int, mixed>|null
Parameters
$id : int
Return values
array<string|int, mixed>|null

findWhere()

Find all records matching criteria.

public findWhere(array<string, mixed> $criteria) : Collection
Parameters
$criteria : array<string, mixed>
Return values
Collection

getBindings()

Get bindings for debugging.

public getBindings(Builder $query) : array<int, mixed>
Parameters
$query : Builder
Return values
array<int, mixed>

paginate()

Find records with pagination support.

public paginate([array<string, mixed> $criteria = [] ][, int $perPage = 15 ][, int $page = 1 ]) : array<string|int, mixed>
Parameters
$criteria : array<string, mixed> = []
$perPage : int = 15
$page : int = 1
Return values
array<string|int, mixed>

toSql()

Get SQL query string for debugging.

public toSql(Builder $query) : string
Parameters
$query : Builder
Return values
string

update()

Update a record by ID.

public update(int $id, array<string, mixed> $data) : bool
Parameters
$id : int
$data : array<string, mixed>
Return values
bool

        
On this page

Search results