mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Possible fix for isUnique backward compatibility
This commit is contained in:
parent
dc7b8cbb89
commit
dcb605c700
1 changed files with 6 additions and 3 deletions
|
@ -3302,9 +3302,12 @@ class Model extends Object implements CakeEventListener {
|
|||
*/
|
||||
public function isUnique($fields, $or = true) {
|
||||
if (is_array($or)) {
|
||||
$args = func_get_args();
|
||||
$fields = $args[1];
|
||||
$or = isset($args[2]) ? $args[2] : true;
|
||||
$isAssociative = count(array_filter(array_keys($or), 'is_string'));
|
||||
if (!$isAssociative) {
|
||||
$args = func_get_args();
|
||||
$fields = $args[1];
|
||||
$or = isset($args[2]) ? $args[2] : true;
|
||||
}
|
||||
}
|
||||
if (!is_array($fields)) {
|
||||
$fields = func_get_args();
|
||||
|
|
Loading…
Reference in a new issue