mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Fix notice errors with postgres.
This commit is contained in:
parent
15c94dee4d
commit
8d1b5c3f24
1 changed files with 7 additions and 7 deletions
|
@ -2874,7 +2874,7 @@ class Model extends Object implements CakeEventListener {
|
||||||
$return = array();
|
$return = array();
|
||||||
if (isset($results[0])) {
|
if (isset($results[0])) {
|
||||||
$prevVal = Hash::get($results[0], $field);
|
$prevVal = Hash::get($results[0], $field);
|
||||||
$query['conditions'][$field . ' >='] = $prevVal[0];
|
$query['conditions'][$field . ' >='] = $prevVal;
|
||||||
$query['conditions'][$field . ' !='] = $value;
|
$query['conditions'][$field . ' !='] = $value;
|
||||||
$query['limit'] = 2;
|
$query['limit'] = 2;
|
||||||
} else {
|
} else {
|
||||||
|
@ -2883,14 +2883,14 @@ class Model extends Object implements CakeEventListener {
|
||||||
$query['limit'] = 1;
|
$query['limit'] = 1;
|
||||||
}
|
}
|
||||||
$query['order'] = $field . ' ASC';
|
$query['order'] = $field . ' ASC';
|
||||||
$return2 = $this->find('all', $query);
|
$neighbors = $this->find('all', $query);
|
||||||
if (!array_key_exists('prev', $return)) {
|
if (!array_key_exists('prev', $return)) {
|
||||||
$return['prev'] = $return2[0];
|
$return['prev'] = $neighbors[0];
|
||||||
}
|
}
|
||||||
if (count($return2) === 2) {
|
if (count($neighbors) === 2) {
|
||||||
$return['next'] = $return2[1];
|
$return['next'] = $neighbors[1];
|
||||||
} elseif (count($return2) === 1 && !$return['prev']) {
|
} elseif (count($neighbors) === 1 && !$return['prev']) {
|
||||||
$return['next'] = $return2[0];
|
$return['next'] = $neighbors[0];
|
||||||
} else {
|
} else {
|
||||||
$return['next'] = null;
|
$return['next'] = null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue