protected function getFormFieldGeneratedRules($forCreate = true)
    {
        $this->generatedRulesMap = [];
        $rules                   = [];

        foreach ($this->info->form->fields as $field) {

            try {
                $this->getFormFieldGeneratedRule($field, $forCreate, $rules);

            } catch (Exception $e) {

                $section = 'form.validation.' . ($forCreate ? 'create' : 'update');

                // Wrap and decorate exceptions so it is easier to track the problem source
                throw (new ModelInformationEnrichmentException(
                    "Issue with validation rules for form field '{$field->key()}' ({$section}): \n{$e->getMessage()}",
                    $e->getCode(),
                    $e
                ))
                    ->setSection($section)
                    ->setKey($field->key());
            }
        }

        return $rules;
    }
protected function getFormFieldGeneratedRules($forCreate = true)
    {
        $this->generatedRulesMap = [];
        $rules                   = [];

        foreach ($this->info->form->fields as $field) {

            try {
                $this->getFormFieldGeneratedRule($field, $forCreate, $rules);

            } catch (Exception $e) {

                $section = 'form.validation.' . ($forCreate ? 'create' : 'update');

                // Wrap and decorate exceptions so it is easier to track the problem source
                throw (new ModelInformationEnrichmentException(
                    "Issue with validation rules for form field '{$field->key()}' ({$section}): \n{$e->getMessage()}",
                    $e->getCode(),
                    $e
                ))
                    ->setSection($section)
                    ->setKey($field->key());
            }
        }

        return $rules;
    }
protected function getFormFieldGeneratedRules ( $ forCreate = true ) { $ this -> generatedRulesMap = [ ] ; $ rules = [ ] ; foreach ( $ this -> info -> form -> fields as $ field ) { try { $ this -> getFormFieldGeneratedRule ( $ field , $ forCreate , $ rules ) ; } catch ( Exception $ e ) { $ section = 'form.validation.' . ( $ forCreate ? 'create' : 'update' ) ; // Wrap and decorate exceptions so it is easier to track the problem source throw ( new ModelInformationEnrichmentException ( "Issue with validation rules for form field '{$field->key()}' ({$section}): \n{$e->getMessage()}" , $ e -> getCode ( ) , $ e ) ) -> setSection ( $ section ) -> setKey ( $ field -> key ( ) ) ; } } return $ rules ; }
Returns rules determined by form field strategies.

@param bool $forCreate
@return array
@throws ModelInformationEnrichmentException
Returns rules determined by form field strategies .