Arikaim CMS

Relations

Relations (Many To Many) trait

Table of Contents

Methods

addRelation()  : Model|false
Add relation
addRelations()  : void
Add relations
getRelationsSourceAttributeName()  : string|null
Get relations source refernce column name
getRelationsTargetAttributeName()  : string|null
Get relations target refernce column name
hasRelation()  : bool
Return true if relation to target id extist
relation()  : Model|false
Get single relation model
removeRelation()  : bool
Delete translation
removeRelations()  : bool
Delete all relations

Methods

addRelation()

Add relation

public addRelation(int $targetId[, array<string|int, mixed> $data = [] ]) : Model|false
Parameters
$targetId : int
$data : array<string|int, mixed> = []
Return values
Model|false

addRelations()

Add relations

public addRelations(array<string|int, mixed> $items) : void
Parameters
$items : array<string|int, mixed>

getRelationsSourceAttributeName()

Get relations source refernce column name

public getRelationsSourceAttributeName() : string|null
Return values
string|null

getRelationsTargetAttributeName()

Get relations target refernce column name

public getRelationsTargetAttributeName() : string|null
Return values
string|null

hasRelation()

Return true if relation to target id extist

public hasRelation(mixed $targetId) : bool
Parameters
$targetId : mixed
Return values
bool

relation()

Get single relation model

public relation(int $id) : Model|false
Parameters
$id : int
Return values
Model|false

removeRelation()

Delete translation

public removeRelation(int $id) : bool
Parameters
$id : int
Return values
bool

removeRelations()

Delete all relations

public removeRelations() : bool
Return values
bool

        
On this page

Search results