public function reorder($objects, $newOrder)
    {
        $sortVals = array_values($objects->map('ID', 'Sort')->toArray());
        sort($sortVals);

        // save the new ID values - but only use existing sort values to prevent
        // conflicts with items not in the table
        foreach ($newOrder as $key => $id) {
            if (!$id) {
                continue;
            }
            $object = $objects->find('ID', $id);
            $object->Sort = $sortVals[$key];
            $object->write();
        }
    }