clear() public method

Clear all parameter.
public clear ( )
Ejemplo n.º 1
0
 /**
  * Stop preview session.
  *
  * @param ConnectionInterface   $from
  * @param MessageHandlerContext $context
  *
  * @return array
  *
  * @throws PreviewNotStartedException
  */
 private function stop(ConnectionInterface $from, MessageHandlerContext $context)
 {
     // check context parameters
     if (!$context->has('user')) {
         throw new PreviewNotStartedException();
     }
     // get user id
     $user = $context->get('user');
     // get session vars
     $contentUuid = $context->get('content');
     $locale = $context->get('locale');
     $webspaceKey = $context->get('webspaceKey');
     // stop preview
     $this->preview->stop($user, $contentUuid, $webspaceKey, $locale);
     $context->clear();
     return ['command' => 'stop', 'content' => $contentUuid, 'msg' => 'OK'];
 }
Ejemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function onClose(ConnectionInterface $conn, MessageHandlerContext $context)
 {
     $this->preview->stop($context->get('previewToken'));
     $context->clear();
 }