FabricatorModel
in
FabricatorModel
An interface defining the required methods and properties needed for a model to qualify for use with the Fabricator class. While interfaces cannot enforce properties, the following are required for use with Fabricator:
Tags
Table of Contents
Methods
- find() : mixed
- Fetches the row of database from $this->table with a primary key matching $id.
- insert() : bool|int|string
- Inserts data into the current table. If an object is provided, it will attempt to convert it to an array.
Methods
find()
Fetches the row of database from $this->table with a primary key matching $id.
public
find([int|array<int, int|string>|string|null $id = null ]) : mixed
Parameters
- $id : int|array<int, int|string>|string|null = null
-
One primary key or an array of primary keys
Tags
insert()
Inserts data into the current table. If an object is provided, it will attempt to convert it to an array.
public
insert([array<string|int, mixed>|object|null $row = null ][, bool $returnID = true ]) : bool|int|string
Parameters
- $row : array<string|int, mixed>|object|null = null
- $returnID : bool = true
-
Whether insert ID should be returned or not.