Skip to content

Internals Model Interfaces IRelationWith

Stefan Crkvenjakov edited this page Oct 7, 2026 · 1 revision

model\interfaces\IRelationWith

Framework Internals · Subsystem overview · Developer guide

Source: awt_src/classes/model/interfaces/IRelationWith.php · Snapshot 8411f4287706.

Models add hydration, persistence, relations, casts and attribute controls to DatabaseManager. Collections hydrate already fetched rows and provide iteration/counting.

IRelationWith

Declaration and architectural role

interface IRelationWith

Constants, enum cases, traits and properties

No own constants, enum cases, traits or property declarations. Inherited members are documented on the parent reference page.

Method index

Method Signature
with public function with(): array

with

Source line 20

public function with(): array;

Return an array with parameters: [ "column" => "example", "model" => namespace/Model, "inConstructor" => true ]

Where column represents a foreign key in your table. inConstructor optional tells model to pass id from column directly into constructor.

@return array

Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.

Clone this wiki locally