original_string: public function onSubmitCallback(DataContainer $dc)
      {
          // Return if the user is allowed to assign categories or the record is not new
          if ($this->permissionChecker->canUserAssignCategories() || $dc->activeRecord->tstamp > 0) {
              return;
          }
  
          $dc->field = 'categories';
  
          $relations = new Relations();
          $relations->updateRelatedRecords($this->permissionChecker->getUserDefaultCategories(), $dc);
  
          // Reset back the field property
          $dc->field = null;
      }
code: public function onSubmitCallback(DataContainer $dc)
      {
          // Return if the user is allowed to assign categories or the record is not new
          if ($this->permissionChecker->canUserAssignCategories() || $dc->activeRecord->tstamp > 0) {
              return;
          }
  
          $dc->field = 'categories';
  
          $relations = new Relations();
          $relations->updateRelatedRecords($this->permissionChecker->getUserDefaultCategories(), $dc);
  
          // Reset back the field property
          $dc->field = null;
      }
code_tokens: public function onSubmitCallback ( DataContainer $ dc ) { // Return if the user is allowed to assign categories or the record is not new if ( $ this -> permissionChecker -> canUserAssignCategories ( ) || $ dc -> activeRecord -> tstamp > 0 ) { return ; } $ dc -> field = 'categories' ; $ relations = new Relations ( ) ; $ relations -> updateRelatedRecords ( $ this -> permissionChecker -> getUserDefaultCategories ( ) , $ dc ) ; // Reset back the field property $ dc -> field = null ; }
docstring: On submit record. Update the category relations.
  
  @param DataContainer $dc
docstring_tokens: On submit record . Update the category relations .