|
@@ -417,11 +417,19 @@ class Validator {
|
|
|
{
|
|
|
if (is_null($this->db)) $this->db = Database::connection();
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if (isset($parameters[1])) $attribute = $parameters[1];
|
|
|
+
|
|
|
$query = $this->db->table($parameters[0])->where($attribute, '=', $value);
|
|
|
|
|
|
- if (isset($parameters[1]))
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if (isset($parameters[2]))
|
|
|
{
|
|
|
- $query->where('id', '<>', $parameters[1]);
|
|
|
+ $query->where('id', '<>', $parameters[2]);
|
|
|
}
|
|
|
|
|
|
return $query->count() == 0;
|