Buffalo Eats Online API Documentation

TableStaffAssignment extends Model
in package

Table staff assignment model.

Manages which staff members are assigned to which tables on a given date for in-store dining service.

Tags
author

J.J. Johnson visionquest716@gmail.com

copyright

2026 VisionQuestServices LLC

Table of Contents

Properties

$db  : PDO
$fillable  : array<string|int, mixed>
$primaryKey  : string
$table  : string

Methods

__construct()  : mixed
Initialize model with database connection.
all()  : array<string|int, mixed>
Get all records from the table.
assign()  : int|false
Assign staff to a table.
count()  : int
Count records matching optional conditions.
create()  : int
Create a new record.
delete()  : bool
Delete a record by primary key.
find()  : array<string|int, mixed>|null
Find a record by primary key.
findBy()  : array<string|int, mixed>|null
Find a record by a specific field value.
getDb()  : PDO
Get the underlying PDO connection.
getForDate()  : array<string|int, mixed>
Get all staff assignments for a business on a given date.
getForTable()  : array<string|int, mixed>
Get staff assigned to a specific table on a date.
getTablesForStaff()  : array<string|int, mixed>
Get tables assigned to a specific staff member on a date.
paginate()  : array<string|int, mixed>
Paginate records matching conditions.
query()  : PDOStatement
Execute a raw SQL query with parameter binding.
unassign()  : bool
Unassign staff from a table.
update()  : bool
Update a record by primary key.
where()  : array<string|int, mixed>
Find records matching conditions.
filterFillable()  : array<string|int, mixed>
Filter data to only include fillable fields.

Properties

$db

protected PDO $db

Database connection

$fillable

protected array<string|int, mixed> $fillable = ['table_id', 'user_id', 'assigned_by', 'shift_date']

Mass-assignable fields

$primaryKey

protected string $primaryKey = 'id'

Primary key column

Methods

__construct()

Initialize model with database connection.

public __construct() : mixed

all()

Get all records from the table.

public all([string $orderBy = 'id' ][, string $direction = 'ASC' ]) : array<string|int, mixed>
Parameters
$orderBy : string = 'id'

Column to order by

$direction : string = 'ASC'

Sort direction (ASC or DESC)

Return values
array<string|int, mixed>

assign()

Assign staff to a table.

public assign(int $tableId, int $userId, string $date[, int|null $assignedBy = null ]) : int|false
Parameters
$tableId : int
$userId : int
$date : string
$assignedBy : int|null = null
Return values
int|false

count()

Count records matching optional conditions.

public count([array<string|int, mixed> $conditions = [] ]) : int
Parameters
$conditions : array<string|int, mixed> = []

Associative array of field => value pairs

Return values
int

create()

Create a new record.

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

Associative array of field => value pairs

Return values
int

The ID of the newly created record

delete()

Delete a record by primary key.

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

Primary key value

Return values
bool

find()

Find a record by primary key.

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

Primary key value

Return values
array<string|int, mixed>|null

findBy()

Find a record by a specific field value.

public findBy(string $field, mixed $value) : array<string|int, mixed>|null
Parameters
$field : string

Column name

$value : mixed

Value to match

Return values
array<string|int, mixed>|null

getDb()

Get the underlying PDO connection.

public getDb() : PDO
Return values
PDO

getForDate()

Get all staff assignments for a business on a given date.

public getForDate(int $businessId, string $date) : array<string|int, mixed>
Parameters
$businessId : int
$date : string

Y-m-d

Return values
array<string|int, mixed>

getForTable()

Get staff assigned to a specific table on a date.

public getForTable(int $tableId, string $date) : array<string|int, mixed>
Parameters
$tableId : int
$date : string
Return values
array<string|int, mixed>

getTablesForStaff()

Get tables assigned to a specific staff member on a date.

public getTablesForStaff(int $userId, string $date) : array<string|int, mixed>
Parameters
$userId : int
$date : string
Return values
array<string|int, mixed>

paginate()

Paginate records matching conditions.

public paginate(array<string|int, mixed> $conditions, int $page, int $perPage[, string $orderBy = 'id' ][, string $direction = 'ASC' ]) : array<string|int, mixed>
Parameters
$conditions : array<string|int, mixed>

Associative array of field => value pairs

$page : int

Current page number (1-based)

$perPage : int

Records per page

$orderBy : string = 'id'

Column to order by

$direction : string = 'ASC'

Sort direction (ASC or DESC)

Return values
array<string|int, mixed>

Pagination result with data, total, page, per_page, total_pages

query()

Execute a raw SQL query with parameter binding.

public query(string $sql[, array<string|int, mixed> $params = [] ]) : PDOStatement
Parameters
$sql : string

SQL query string

$params : array<string|int, mixed> = []

Bound parameters

Return values
PDOStatement

unassign()

Unassign staff from a table.

public unassign(int $tableId, int $userId, string $date) : bool
Parameters
$tableId : int
$userId : int
$date : string
Return values
bool

update()

Update a record by primary key.

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

Primary key value

$data : array<string|int, mixed>

Associative array of field => value pairs

Return values
bool

where()

Find records matching conditions.

public where(array<string|int, mixed> $conditions[, string $orderBy = 'id' ][, string $direction = 'ASC' ]) : array<string|int, mixed>
Parameters
$conditions : array<string|int, mixed>

Associative array of field => value pairs

$orderBy : string = 'id'

Column to order by

$direction : string = 'ASC'

Sort direction

Return values
array<string|int, mixed>

filterFillable()

Filter data to only include fillable fields.

protected filterFillable(array<string|int, mixed> $data) : array<string|int, mixed>
Parameters
$data : array<string|int, mixed>

Input data

Return values
array<string|int, mixed>

Filtered data


        
On this page

Search results