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() : row_array>)
- 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 ]) : row_array>)
Parameters
- $id : int|array<int, int|string>|string|null = null
-
One primary key or an array of primary keys
Return values
row_array>)insert()
Inserts data into the current table. If an object is provided, it will attempt to convert it to an array.
public
insert([object|row_array|null $row = null ][, bool $returnID = true ]) : bool|int|string
Parameters
- $row : object|row_array|null = null
- $returnID : bool = true
-
Whether insert ID should be returned or not.