protected function setRequiredFieldErrors($fields = null, $data = null)
    {
        if ($fields === null) {
            $fields =& $this->fields;
        }

        if ($data === null) {
            $data =& $this->data;
        }

        foreach ($fields as $field) {
            if (isset($field['options']['required']) && $field['options']['required'] === true) {
                if (!isset($data[ $field['name'] ]) || $data[ $field['name'] ] == null) {
                    if (isset($field['options']['label'])) {
                        $label = $field['options']['label'];
                    }
                    else {
                        $label = $field['name'];
                    }
                    $this->errors[] = new FormError($field['name'], "Field '{field_label}' must be set", true, array('field_label' => $label));
                }
            }

            if (isset($field['fields'])) {
                $this->setRequiredFieldErrors($field['fields'], $data[ $field['name'] ]);
            }
        }
    }