Skip to content

Commit

Permalink
CS
Browse files Browse the repository at this point in the history
  • Loading branch information
dergel committed Jan 8, 2024
1 parent 03e8fa3 commit 0adbe0d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions plugins/rest/lib/rest/route.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public function handleRequest(array $paths, array $get)
$id = $path;
$id_column = 'id';
if ('' != $query->getTableAlias()) {
$id_column = $query->getTableAlias().'.id';
$id_column = $query->getTableAlias() . '.id';
}

$query
Expand Down Expand Up @@ -224,7 +224,7 @@ public function handleRequest(array $paths, array $get)

$instance_data = $this->getInstanceData(
$instance,
array_merge($paths, [$instance->getId()])
array_merge($paths, [$instance->getId()]),
);
if (is_callable($this->getItemFunc)) {
$instance_data = call_user_func($this->getItemFunc, $this, $instance_data);
Expand Down Expand Up @@ -259,18 +259,18 @@ public function handleRequest(array $paths, array $get)
$links['self'] = rex_yform_rest::getLinkByPath($this, $linkParams);
$links['first'] = rex_yform_rest::getLinkByPath($this, array_merge(
$linkParams,
['page' => 1]
['page' => 1],
));
if (($currentPage - 1) > 0) {
$links['prev'] = rex_yform_rest::getLinkByPath($this, array_merge(
$linkParams,
['page' => ($currentPage - 1)]
['page' => ($currentPage - 1)],
));
}
if (($currentPage * $per_page) < $itemsAll) {
$links['next'] = rex_yform_rest::getLinkByPath($this, array_merge(
$linkParams,
['page' => ($currentPage + 1)]
['page' => ($currentPage + 1)],
));
}

Expand All @@ -286,7 +286,7 @@ public function handleRequest(array $paths, array $get)
} else {
$data = $this->getInstanceData(
$instance,
array_merge($paths)
array_merge($paths),
);
if (is_callable($this->getItemFunc)) {
$data = call_user_func($this->getItemFunc, $this, $data);
Expand All @@ -302,7 +302,7 @@ public function handleRequest(array $paths, array $get)

break;

// ----- /END GET
// ----- /END GET

case 'post':
$instance = $table->createDataset();
Expand Down Expand Up @@ -575,7 +575,7 @@ private function filterFieldsByInclude(array $fields, array $parents = []): arra

$newFields = [];
foreach ($fields as $key => $field) {
$compareKey = 0 == count($parents) ? $key : implode('.', $parents).'.'.$key;
$compareKey = 0 == count($parents) ? $key : implode('.', $parents) . '.' . $key;
if (in_array($compareKey, $this->getIncludes(), true)) {
$newFields[$key] = $field;
}
Expand Down Expand Up @@ -613,7 +613,7 @@ public function getInstanceRelationships(rex_yform_manager_dataset $instance, $p
$relationInstance,
array_merge($paths, [$field->getName(), $relationInstance->getId()]),
$onlyId,
$fieldParents
$fieldParents,
);
}
$return[$field->getName()] = [
Expand Down
2 changes: 1 addition & 1 deletion ytemplates/bootstrap/errors.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<?php
if ($this->objparams['warning_messages'] || $this->objparams['unique_error']):
if ($this->objparams['Error-occured']):
if ($this->objparams['Error-occured']):
if($this->objparams['warning_intro']) { ?>
<p><?= $this->objparams['warning_intro'] ?></p>
<?php } ?>
Expand Down

0 comments on commit 0adbe0d

Please sign in to comment.