InsertModel
Contract for models able to insert a new document.
An InsertModel exposes a single InsertModel::insert() operation that
creates a new document in the underlying storage. Implementations usually emit
beforeInsert/afterInsert signals around the operation so observers can
inspect or react to the created document.
Tags
Table of Contents
Methods
- insert() : mixed
- Inserts a new document into the model.
Methods
insert()
Inserts a new document into the model.
public
insert([array<string|int, mixed> $init = [] ]) : mixed
Parameters
- $init : array<string|int, mixed> = []
-
Operation options carrying the data to insert, typically the
documentpayload, optionalbindsand a return clause describing what the call should yield.
Tags
Return values
mixed —The inserted document (or its identifier/result), depending on the implementation.