public function validateFieldSettings(SuperTableField $supertableField): bool
    {
        $validates = true;

        foreach ($supertableField->getBlockTypes() as $blockType) {
            if (!$this->validateBlockType($blockType, false)) {
                $validates = false;

                $blockTypeErrors = $blockType->getErrors();

                // Make sure to look at validation for each field
                if (!$blockTypeErrors) {
                    foreach ($blockType->getFields() as $blockTypeField) {
                        $blockTypeFieldErrors = $blockTypeField->getErrors();

                        if ($blockTypeFieldErrors) {
                            $blockTypeErrors[] = $blockTypeFieldErrors;
                        }
                    }
                }

                // Make sure to add any errors to the actual Super Table field. Really important when its
                // being nested in a Matrix field, because Matrix checks for the presence of errors - not the result
                // of this function (which correctly returns false).
                $supertableField->addErrors([ $blockType->id => $blockTypeErrors ]);
            }
        }

        return $validates;
    }
public function validateFieldSettings(SuperTableField $supertableField): bool
    {
        $validates = true;

        foreach ($supertableField->getBlockTypes() as $blockType) {
            if (!$this->validateBlockType($blockType, false)) {
                $validates = false;

                $blockTypeErrors = $blockType->getErrors();

                // Make sure to look at validation for each field
                if (!$blockTypeErrors) {
                    foreach ($blockType->getFields() as $blockTypeField) {
                        $blockTypeFieldErrors = $blockTypeField->getErrors();

                        if ($blockTypeFieldErrors) {
                            $blockTypeErrors[] = $blockTypeFieldErrors;
                        }
                    }
                }

                // Make sure to add any errors to the actual Super Table field. Really important when its
                // being nested in a Matrix field, because Matrix checks for the presence of errors - not the result
                // of this function (which correctly returns false).
                $supertableField->addErrors([ $blockType->id => $blockTypeErrors ]);
            }
        }

        return $validates;
    }
public function validateFieldSettings ( SuperTableField $ supertableField ) : bool { $ validates = true ; foreach ( $ supertableField -> getBlockTypes ( ) as $ blockType ) { if ( ! $ this -> validateBlockType ( $ blockType , false ) ) { $ validates = false ; $ blockTypeErrors = $ blockType -> getErrors ( ) ; // Make sure to look at validation for each field if ( ! $ blockTypeErrors ) { foreach ( $ blockType -> getFields ( ) as $ blockTypeField ) { $ blockTypeFieldErrors = $ blockTypeField -> getErrors ( ) ; if ( $ blockTypeFieldErrors ) { $ blockTypeErrors [ ] = $ blockTypeFieldErrors ; } } } // Make sure to add any errors to the actual Super Table field. Really important when its // being nested in a Matrix field, because Matrix checks for the presence of errors - not the result // of this function (which correctly returns false). $ supertableField -> addErrors ( [ $ blockType -> id => $ blockTypeErrors ] ) ; } } return $ validates ; }
Validates a Super Table field's settings.

If the settings don’t validate, any validation errors will be stored on the settings model.

@param SuperTableField $supertableField The Super Table field

@return bool Whether the settings validated.
Validates a Super Table field s settings .