original_string: protected function applyConfig(array $moduleConfiguration)
      {
          foreach ($moduleConfiguration['customer_group'] as $customerGroupData) {
              if (CustomerGroupQuery::create()->findOneByCode($customerGroupData['code']) === null) {
                  $customerGroup = (new CustomerGroup)
                      ->setCode($customerGroupData['code']);
  
                  foreach ($customerGroupData['descriptive'] as $descriptiveData) {
                      $customerGroup
                          ->setLocale($descriptiveData['locale'])
                          ->setTitle($descriptiveData['title'])
                          ->setDescription($descriptiveData['description']);
                  }
  
                  $customerGroup->save();
              }
          }
  
          if ($moduleConfiguration['default']) {
              $customerGroup = CustomerGroupQuery::create()->findOneByCode($moduleConfiguration['default']);
              if ($customerGroup !== null) {
                  $this->resetDefault();
  
                  $customerGroup
                      ->setIsDefault(true)
                      ->save();
              }
          }
      }
code: protected function applyConfig(array $moduleConfiguration)
      {
          foreach ($moduleConfiguration['customer_group'] as $customerGroupData) {
              if (CustomerGroupQuery::create()->findOneByCode($customerGroupData['code']) === null) {
                  $customerGroup = (new CustomerGroup)
                      ->setCode($customerGroupData['code']);
  
                  foreach ($customerGroupData['descriptive'] as $descriptiveData) {
                      $customerGroup
                          ->setLocale($descriptiveData['locale'])
                          ->setTitle($descriptiveData['title'])
                          ->setDescription($descriptiveData['description']);
                  }
  
                  $customerGroup->save();
              }
          }
  
          if ($moduleConfiguration['default']) {
              $customerGroup = CustomerGroupQuery::create()->findOneByCode($moduleConfiguration['default']);
              if ($customerGroup !== null) {
                  $this->resetDefault();
  
                  $customerGroup
                      ->setIsDefault(true)
                      ->save();
              }
          }
      }
code_tokens: protected function applyConfig ( array $ moduleConfiguration ) { foreach ( $ moduleConfiguration [ 'customer_group' ] as $ customerGroupData ) { if ( CustomerGroupQuery :: create ( ) -> findOneByCode ( $ customerGroupData [ 'code' ] ) === null ) { $ customerGroup = ( new CustomerGroup ) -> setCode ( $ customerGroupData [ 'code' ] ) ; foreach ( $ customerGroupData [ 'descriptive' ] as $ descriptiveData ) { $ customerGroup -> setLocale ( $ descriptiveData [ 'locale' ] ) -> setTitle ( $ descriptiveData [ 'title' ] ) -> setDescription ( $ descriptiveData [ 'description' ] ) ; } $ customerGroup -> save ( ) ; } } if ( $ moduleConfiguration [ 'default' ] ) { $ customerGroup = CustomerGroupQuery :: create ( ) -> findOneByCode ( $ moduleConfiguration [ 'default' ] ) ; if ( $ customerGroup !== null ) { $ this -> resetDefault ( ) ; $ customerGroup -> setIsDefault ( true ) -> save ( ) ; } } }
docstring: Save new customer group to database
  
  @param array $moduleConfiguration Customer group module configuration
docstring_tokens: Save new customer group to database