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