HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux aritmodecarnaval.es 5.15.0-79-generic #86-Ubuntu SMP Mon Jul 10 16:07:21 UTC 2023 x86_64
User: www-data (33)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /home/www/torresncgolf/wp-content/plugins/ninja-forms/includes/Adapters/SubmissionsSubmission.php
<?php
// namespace NinjaForms\Pdf\Adapters;

final class NF_Adapters_SubmissionsSubmission extends NF_Adapters_SubmissionsFields
{
    protected $fields;
    protected $submission;

    public function __construct($fields, $form_id, $submission)
    {
        parent::__construct($fields, $form_id);
        $this->submission = $submission;
    }

    /*
    |--------------------------------------------------------------------------
    | ArrayAccess
    |--------------------------------------------------------------------------
    */

    public function offsetExists($offset)
    {
        if (isset($this->fields[$offset])) {
            return true;
        }
        return $this->offsetMaybeCreate($offset);
    }

    public function offsetGet($offset)
    {
        if (isset($this->fields[$offset])) {
            return $this->fields[$offset];
        }
        return $this->offsetMaybeCreate($offset);
    }

    protected function offsetMaybeCreate($offset)
    {
        foreach ($this->fields as $field) {
            if ($offset != $field->get_setting('key')) {
                continue;
            }

            return $this->fields[$offset] = [
                'id' => $field->get_id(),
                'type' => $field->get_setting('type'),
                'label' => $field->get_setting('label'),
                'admin_label' => $field->get_setting('admin_label'),
                'value' => $this->submission->get_field_value($field->get_id()),
                'key' => $field->get_setting( 'key' ),
                'options' => $field->get_setting( 'options' )
            ];
        }
        return false;
    }

    /*
    |--------------------------------------------------------------------------
    | Iterator
    |--------------------------------------------------------------------------
    */

    public function current()
    {
        $field = current($this->fields);

        return [
            'id' => $field->get_id(),
            'type' => $field->get_setting('type'),
            'label' => $field->get_setting('label'),
            'admin_label' => $field->get_setting('admin_label'),
            'value' => $this->submission->get_field_value($field->get_id()),
            'key' => $field->get_setting( 'key' ),
            'options' => $field->get_setting( 'options' )
        ];
    }
}