function SessionHelper::setPath

Same name in other branches
  1. 3.x modules/stream_wrapper_example/src/SessionHelper.php \Drupal\stream_wrapper_example\SessionHelper::setPath()
  2. 4.0.x modules/stream_wrapper_example/src/SessionHelper.php \Drupal\stream_wrapper_example\SessionHelper::setPath()

Set a path.

Parameters

string $path: Path into the store.

string|array $value: Set a value.

File

stream_wrapper_example/src/SessionHelper.php, line 200

Class

SessionHelper
Helper to manage file wrapper data stored in the session object.

Namespace

Drupal\stream_wrapper_example

Code

public function setPath($path, $value) {
    $path_info = $this->getParentPath($path);
    $store_info = $this->processPath($path_info['dirname']);
    if ($store_info !== FALSE) {
        $store_info['tip'][$path_info['basename']] = $value;
    }
    $this->setStore($store_info['store']);
}