src/Fieldset.php
public function getRequiredFieldNames()
    {
        $results = [];
        if (!isset($this->data['fields']) || empty($this->data['fields'])) {
            return $results;
        }

        $table = $this->data['name'];
        foreach ($this->data['fields'] as $field) {
            $name = $table . '_' . $field['name'];
            if (!isset($field['validation'])) {
                continue;
            }

            foreach ($field['validation'] as $validation) {
                if ($validation['method'] === 'required') {
                    $results[] = $name;
                    break;
                }
            }
        }

        return $results;
    }
public function getRequiredFieldNames()
    {
        $results = [];
        if (!isset($this->data['fields']) || empty($this->data['fields'])) {
            return $results;
        }

        $table = $this->data['name'];
        foreach ($this->data['fields'] as $field) {
            $name = $table . '_' . $field['name'];
            if (!isset($field['validation'])) {
                continue;
            }

            foreach ($field['validation'] as $validation) {
                if ($validation['method'] === 'required') {
                    $results[] = $name;
                    break;
                }
            }
        }

        return $results;
    }
public function getRequiredFieldNames ( ) { $ results = [ ] ; if ( ! isset ( $ this -> data [ 'fields' ] ) || empty ( $ this -> data [ 'fields' ] ) ) { return $ results ; } $ table = $ this -> data [ 'name' ] ; foreach ( $ this -> data [ 'fields' ] as $ field ) { $ name = $ table . '_' . $ field [ 'name' ] ; if ( ! isset ( $ field [ 'validation' ] ) ) { continue ; } foreach ( $ field [ 'validation' ] as $ validation ) { if ( $ validation [ 'method' ] === 'required' ) { $ results [ ] = $ name ; break ; } } } return $ results ; }
Returns a list of required fields

@return array
Returns a list of required fields