CodeIgniter v4.5 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

Tags
phpstan-return

($id is int|string ? row_array|object|null : list<row_array|object>)

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.

Tags
phpstan-param

row_array|object|null $row

throws
ReflectionException
Return values
bool|int|string

        
On this page

Search results