[eluser]Frychiko[/eluser]
I have a callback to check for a unique name in a db:
Code:
function name_unique($str)
{
$row = $this->Field_model->get_where(array(
"name" => $str
));
if (!$row)
return TRUE;
else
{
$this->validation->set_message("name_unique", "The %s field already exists");
return FALSE;
}
}
This is fine for insertion...
but for updating I need to know the original name also.
(ie. if (name is unique OR original_name == name) return TRUE)
Is their anyway I can pass in this extra info?... without using a class variable or something global..
cheers!