/**
* {@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;
}