Skip to content

Internals Model Interfaces IRelationBelongs

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

model\interfaces\IRelationBelongs

Framework Internals · Subsystem overview · Developer guide

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

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

Imports and dependencies

use model\Model;

IRelationBelongs

Declaration and architectural role

interface IRelationBelongs

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
belongsTo public function belongsTo(): array

belongsTo

Source line 21

public function belongsTo(): 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.

Related types

Clone this wiki locally