CodeExplorer resolveFields example
$result->type =
$this->type;
if ($criteria->calculateTotal
) { $result->total =
(int) $this->connection->
fetchColumn('SELECT FOUND_ROWS()'
);
} if ($criteria->loadTranslations
) { $items =
$this->
translateItems($query->
execute()->
fetchAll());
} if ($criteria->loadAssociations
) { $items =
$this->fieldResolver->
resolveFields($this->type,
$items);
} $result->items =
$items;
return $result;
} public function save(array
$data, ?int
$id = null
): int
{ $this->
validateFields($data);
$data =
$this->
filterFields($data);