Microweber\Providers\CategoryManager::reorder PHP Method

reorder() public method

public reorder ( $data )
    public function reorder($data)
    {
        $table = $this->tables['categories'];
        $res = array();
        foreach ($data as $value) {
            if (is_array($value)) {
                $indx = array();
                $i = 0;
                foreach ($value as $value2) {
                    $indx[$i] = $value2;
                    ++$i;
                }
                $res[] = $this->app->database_manager->update_position_field($table, $indx);
            }
        }
        return $res;
    }