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;
    }
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;
    }
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 ; }
On submit record. Update the category relations.

@param DataContainer $dc
On submit record . Update the category relations .