Jackalope\Transport\TransportInterface::login PHP Метод

login() публичный Метод

This can only be called once. To connect to another workspace or with another credential, use a fresh instance of transport. What implementation of credentials is supported is transport specific.
public login ( PHPCR\CredentialsInterface $credentials = null, string $workspaceName = null ) : string
$credentials PHPCR\CredentialsInterface the credentials to connect with the backend
$workspaceName string The workspace name to connect to. Null means to connect to the default workspace.
Результат string The workspace name that we connected to. This must be $workspaceName unless that was null, where it is the name of the default workspace.
    public function login(CredentialsInterface $credentials = null, $workspaceName = null);

Usage Example

Пример #1
0
 /**
  * {@inheritDoc}
  *
  * @api
  */
 public function login(CredentialsInterface $credentials = null, $workspaceName = null)
 {
     if (!($workspaceName = $this->transport->login($credentials, $workspaceName))) {
         throw new RepositoryException('transport failed to login without telling why');
     }
     /** @var $session Session */
     $session = $this->factory->get('Session', array($this, $workspaceName, $credentials, $this->transport));
     $session->setSessionOption(Session::OPTION_AUTO_LASTMODIFIED, $this->options[Session::OPTION_AUTO_LASTMODIFIED]);
     if ($this->options['transactions']) {
         $utx = $this->factory->get('Transaction\\UserTransaction', array($this->transport, $session, $session->getObjectManager()));
         $session->getWorkspace()->setTransactionManager($utx);
     }
     return $session;
 }
All Usage Examples Of Jackalope\Transport\TransportInterface::login