original_string: protected function updateFormatCountry()
      {
          $format = $this->getSubmitted();
  
          foreach ($format as $id => &$item) {
  
              $item['status'] = isset($item['status']);
              $item['required'] = isset($item['required']);
  
              if ($id === 'country') {
                  $item['status'] = 1;
                  $item['required'] = 1;
              }
  
              if ($item['required']) {
                  $item['status'] = 1;
              }
          }
  
          if ($this->country->update($this->data_country['code'], array('format' => $format))) {
              $this->redirect('admin/settings/country', $this->text('Country has been updated'), 'success');
          }
  
          $this->redirect('', $this->text('Country has not been updated'), 'warning');
      }
code: protected function updateFormatCountry()
      {
          $format = $this->getSubmitted();
  
          foreach ($format as $id => &$item) {
  
              $item['status'] = isset($item['status']);
              $item['required'] = isset($item['required']);
  
              if ($id === 'country') {
                  $item['status'] = 1;
                  $item['required'] = 1;
              }
  
              if ($item['required']) {
                  $item['status'] = 1;
              }
          }
  
          if ($this->country->update($this->data_country['code'], array('format' => $format))) {
              $this->redirect('admin/settings/country', $this->text('Country has been updated'), 'success');
          }
  
          $this->redirect('', $this->text('Country has not been updated'), 'warning');
      }
code_tokens: protected function updateFormatCountry ( ) { $ format = $ this -> getSubmitted ( ) ; foreach ( $ format as $ id => & $ item ) { $ item [ 'status' ] = isset ( $ item [ 'status' ] ) ; $ item [ 'required' ] = isset ( $ item [ 'required' ] ) ; if ( $ id === 'country' ) { $ item [ 'status' ] = 1 ; $ item [ 'required' ] = 1 ; } if ( $ item [ 'required' ] ) { $ item [ 'status' ] = 1 ; } } if ( $ this -> country -> update ( $ this -> data_country [ 'code' ] , array ( 'format' => $ format ) ) ) { $ this -> redirect ( 'admin/settings/country' , $ this -> text ( 'Country has been updated' ) , 'success' ) ; } $ this -> redirect ( '' , $ this -> text ( 'Country has not been updated' ) , 'warning' ) ; }
docstring: Updates a country format
docstring_tokens: Updates a country format