CodeIgniter v4.6 API

FabricatorModel

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
phpstan-import-type

row_array from BaseModel

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

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.

Tags
throws
ReflectionException
Return values
bool|int|string

        
On this page

Search results