public function reorder($table, $weight_field, $id_field, $ids)
{
$success = false;
$ids = (array) $ids;
list($table, $weight_field, $id_field, $ids) = $this->do_hook('reorder', array($table, $weight_field, $id_field, $ids));
if (!empty($ids)) {
$success = true;
foreach ($ids as $weight => $id) {
$updated = $this->update($table, array($weight_field => $weight), array($id_field => $id), array('%d'), array('%d'));
if (false === $updated) {
$success = false;
}
}
}
return $success;
}