Advertisement:

Author Topic: What are the functions that are in the Session.php class?  (Read 239 times)

Xefiron

  • Newbie
  • *
  • Posts: 32
  • Software developer - Desarrollador de software
What are the functions that are in the Session.php class?
« on: May 16, 2019, 02:44:42 am »
I have the following function that comes with a topic that I occupy, that calls a function of the Session.php class, but I do not understand what it does, I opened the Session.php class but the functions it has are even more confusing, since there is no documentation on what they do as in the case of helpers, any help ?, both for me and for those who use this same subject of reference, thank you for your attention.

Item-post.php

Code: [Select]
$prepare['i_region'] = veronika_get_session('sRegion') <> '' ? veronika_get_session('sRegion') : osc_user_region_id();
Functions.php (Of theme)
Code: [Select]
function veronika_get_session( $param ) {
  return Session::newInstance()->_getForm($param);
}

Session.php

Code: [Select]
function _getForm($key = '') {
            $form = $this->_get('form');
            if($key!='') {
                if ( isset($form[$key]) ) {
                    return ( $form[$key] );
                } else {
                    return ( '' );
                }
            } else {
                return $form;
            }
        }

function _get($key) {
            if (!isset($this->session[$key])) {
                return '';
            }

            return ($this->session[$key]);
        }