/** * Returns the type definition cache from the session. * * @param BindingSessionInterface $session * @return Cache * @throws CmisRuntimeException Exception is thrown if cache instance could not be initialized. */ public function getTypeDefinitionCache(BindingSessionInterface $session) { $cache = $session->get(self::TYPE_DEFINITION_CACHE); if ($cache !== null) { return $cache; } $className = $session->get(SessionParameter::TYPE_DEFINITION_CACHE_CLASS); try { $cache = new $className(); } catch (\Exception $exception) { throw new CmisRuntimeException(sprintf('Could not create object of type "%s"!', $className), null, $exception); } $session->put(self::TYPE_DEFINITION_CACHE, $cache); return $cache; }
/** * Returns the client session id. * * @return string */ public function getSessionId() { return $this->session->getSessionId(); }
/** * Sets the current session. * * @param BindingSessionInterface $session */ protected function setSession(BindingSessionInterface $session) { $this->session = $session; $succinct = $session->get(SessionParameter::BROWSER_SUCCINCT); $this->succinct = $succinct === null ? true : (bool) $succinct; $this->dateTimeFormat = DateTimeFormat::cast($session->get(SessionParameter::BROWSER_DATETIME_FORMAT)); }