Skip to content
Permalink
Browse files

Fix class name usage to const

  • Loading branch information...
dereuromark committed Oct 30, 2018
1 parent cbc4480 commit c7efbf469f1b072cfea3d0025cec9c1547fa222f
Showing with 10 additions and 2 deletions.
  1. +10 −2 src/ORM/Table.php
@@ -150,7 +150,14 @@ class Table implements RepositoryInterface, EventListenerInterface, EventDispatc
*
* @var string
*/
const RULES_CLASS = 'Cake\ORM\RulesChecker';
const RULES_CLASS = RulesChecker::class;
/**
* The IsUnique class name that is used.
*
* @var string
*/
const IS_UNIQUE_CLASS = IsUnique::class;
/**
* Name of the table as it can be found in the database
@@ -2797,7 +2804,8 @@ public function validateUnique($value, array $options, array $context = null)
return false;
}
}
$rule = new IsUnique($fields, $options);
$class = static::IS_UNIQUE_CLASS;
$rule = new $class($fields, $options);
return $rule($entity, ['repository' => $this]);
}

0 comments on commit c7efbf4

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.