private function update_fields($request)
 {
     if ($request->get_value('submit', false)) {
         $this->update_position($request);
         ExtendedFieldsCache::invalidate();
         $this->view->put('MSG', MessageHelper::display(LangLoader::get_message('message.success.position.update', 'status-messages-common'), MessageHelper::SUCCESS, 5));
     }
 }
 public function execute(HTTPRequestCustom $request)
 {
     $id = $request->get_int('id', 0);
     $display = $request->get_bool('display', true);
     if ($id !== 0) {
         PersistenceContext::get_querier()->update(DB_TABLE_MEMBER_EXTENDED_FIELDS_LIST, array('display' => (int) $display), 'WHERE id = :id', array('id' => $id));
         ExtendedFieldsCache::invalidate();
     }
     return new JSONResponse(array('id' => $id, 'display' => (int) $display));
 }
 /**
  * @desc Delete a extended field for field name
  * @param string $field_name the field name of the extended field
  */
 public static function delete_by_field_name($field_name)
 {
     if (!empty($field_name)) {
         $extended_field = new ExtendedField();
         $extended_field->set_field_name($field_name);
         if (ExtendedFieldsDatabaseService::check_field_exist_by_field_name($extended_field)) {
             $data = self::data_field($extended_field, self::SORT_BY_FIELD_NAME);
             $class = $data->get_instance();
             if (!$class->get_field_used_phpboost_configuration() || !$data->get_is_freeze()) {
                 ExtendedFieldsDatabaseService::delete_extended_field($data);
                 ExtendedFieldsCache::invalidate();
             }
         }
     }
 }