protected function getRelevantFormFieldKeys($creating = false)
    {
        $fieldKeys = $this->getModelInformation()->form->getLayoutFormFieldKeys();

        // Filter out keys that should not be available
        $fieldKeys = array_filter($fieldKeys, function ($key) use ($creating) {

            if ( ! array_key_exists($key, $this->getModelInformation()->form->fields)) {
                throw new UnexpectedValueException(
                    "Layout field key '{$key}' not found in fields form data for "
                    . $this->getModelInformation()->modelClass()
                );
            }

            $fieldData = $this->getModelInformation()->form->fields[$key];

            if ( ! $this->allowedToUseFormFieldData($fieldData)) {
                return false;
            }

            if ($creating) {
                return $fieldData->create();
            }

            return $fieldData->update();
        });

        return $fieldKeys;
    }
protected function getRelevantFormFieldKeys($creating = false)
    {
        $fieldKeys = $this->getModelInformation()->form->getLayoutFormFieldKeys();

        // Filter out keys that should not be available
        $fieldKeys = array_filter($fieldKeys, function ($key) use ($creating) {

            if ( ! array_key_exists($key, $this->getModelInformation()->form->fields)) {
                throw new UnexpectedValueException(
                    "Layout field key '{$key}' not found in fields form data for "
                    . $this->getModelInformation()->modelClass()
                );
            }

            $fieldData = $this->getModelInformation()->form->fields[$key];

            if ( ! $this->allowedToUseFormFieldData($fieldData)) {
                return false;
            }

            if ($creating) {
                return $fieldData->create();
            }

            return $fieldData->update();
        });

        return $fieldKeys;
    }
protected function getRelevantFormFieldKeys ( $ creating = false ) { $ fieldKeys = $ this -> getModelInformation ( ) -> form -> getLayoutFormFieldKeys ( ) ; // Filter out keys that should not be available $ fieldKeys = array_filter ( $ fieldKeys , function ( $ key ) use ( $ creating ) { if ( ! array_key_exists ( $ key , $ this -> getModelInformation ( ) -> form -> fields ) ) { throw new UnexpectedValueException ( "Layout field key '{$key}' not found in fields form data for " . $ this -> getModelInformation ( ) -> modelClass ( ) ) ; } $ fieldData = $ this -> getModelInformation ( ) -> form -> fields [ $ key ] ; if ( ! $ this -> allowedToUseFormFieldData ( $ fieldData ) ) { return false ; } if ( $ creating ) { return $ fieldData -> create ( ) ; } return $ fieldData -> update ( ) ; } ) ; return $ fieldKeys ; }
Returns a list of form field keys relevant for the current context,
depending on whether the model is being created or updated.

@param bool $creating
@return string[]
Returns a list of form field keys relevant for the current context depending on whether the model is being created or updated .