You are here

public function SessionHelper::setPath in Examples for Developers 3.x

Same name and namespace in other branches
  1. 8 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

modules/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']);
}