Example #1
0
 function updateCartoMobileSettings($data, $_key_)
 {
     $table = new Table("settings.geometry_columns_join");
     $data = $table->makeArray($data);
     $cartomobileArr = (array) json_decode($this->getValueFromKey($_key_, "cartomobile"));
     foreach ($data as $value) {
         $safeColumn = $table->toAscii($value->column, array(), "_");
         if ($value->id != $value->column && $value->column && $value->id) {
             unset($cartomobileArr[$value->id]);
         }
         $cartomobileArr[$safeColumn] = $value;
     }
     $conf['cartomobile'] = json_encode($cartomobileArr);
     $conf['_key_'] = $_key_;
     $table->updateRecord(json_decode(json_encode($conf)), "_key_");
     //$this->execQuery($sql, "PDO", "transaction");
     if (!$this->PDOerror) {
         $response['success'] = true;
         $response['message'] = "Column renamed";
     } else {
         $response['success'] = false;
         $response['message'] = $this->PDOerror[0];
     }
     return $response;
 }