mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-06-19 05:03:43 +00:00
parent
1ded0c21dd
commit
50b3893e65
2 changed files with 7 additions and 3 deletions
lib/Cake/Model
|
@ -3302,8 +3302,12 @@ class Model extends Object implements CakeEventListener {
|
|||
*/
|
||||
public function isUnique($fields, $or = true) {
|
||||
if (is_array($or)) {
|
||||
$isAssociative = count(array_filter(array_keys($or), 'is_string'));
|
||||
if (!$isAssociative) {
|
||||
$isRule = (
|
||||
array_key_exists('rule', $or) &&
|
||||
array_key_exists('required', $or) &&
|
||||
array_key_exists('message', $or)
|
||||
);
|
||||
if (!$isRule) {
|
||||
$args = func_get_args();
|
||||
$fields = $args[1];
|
||||
$or = isset($args[2]) ? $args[2] : true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue