CoolCMS API

SaveTrait

Generic repository `save()` and `updateColumns()` through a bridge POST to the Api endpoint.

It is not tied to a module (Front/Admin), so both bridge stacks share it.

Table of Contents

Methods

save()  : Result
updateColumns()  : Result
getApiCallSource()  : string
Returns the caller branch ({@see \App\Core\Bridge\ApiBridge::PARAM_SOURCE}); implemented by the Front and Admin base `ApiRepository`.

Methods

save()

public save(array<string, mixed> $data[, array<string, mixed> $meta = [] ][, array<int, string> $skipFields = [] ]) : Result
Parameters
$data : array<string, mixed>

extracted entity payload

$meta : array<string, mixed> = []
$skipFields : array<int, string> = []
Return values
Result

updateColumns()

public updateColumns(array<string|int, mixed> $ids, array<string, mixed> $values) : Result
Parameters
$ids : array<string|int, mixed>

ids or composite-id arrays

$values : array<string, mixed>

property name => new value

Return values
Result

getApiCallSource()

Returns the caller branch ({@see \App\Core\Bridge\ApiBridge::PARAM_SOURCE}); implemented by the Front and Admin base `ApiRepository`.

protected abstract getApiCallSource() : string
Return values
string
On this page

Search results