$em->remove($userMessage); $em->flush(); $userSubscription = new User\Subscription($subscribingUser, 'testSubscription', 'testType'); $em->persist($userSubscription); $em->flush(); $em->remove($userSubscription); $em->flush(); $em->remove($subscribingUser); $em->flush(); $connection = new Connection('test-idp' . time(), 'saml20-idp'); $connection->update($connection->getName(), $connection->getType(), null, 'initial', 'testaccepted', new \DateTime(), 'http://test', true, array('foo'), null, true, null); $connectionRevision = $connection->getLatestRevision(); $em->persist($connection); $em->flush(); $remoteConnection = new Connection('test-sp' . time(), 'saml20-sp'); $remoteConnection->update($remoteConnection->getName(), $remoteConnection->getType(), null, 'initial', 'test', new \DateTime(), 'http://test', true, null, null, true, null); $remoteConnectionRevision = $remoteConnection->getLatestRevision(); $em->persist($remoteConnection); $em->flush(); $connectionAllowedConnectionRelation = new Connection\Revision\AllowedConnectionRelation($connectionRevision, $remoteConnection); $em->persist($connectionAllowedConnectionRelation); $em->flush(); $em->remove($connectionAllowedConnectionRelation); $em->flush(); $connectionBlockedConnectionRelation = new Connection\Revision\BlockedConnectionRelation($connectionRevision, $remoteConnection); $em->persist($connectionBlockedConnectionRelation); $em->flush(); $em->remove($connectionBlockedConnectionRelation); $em->flush(); $connectionDisableConsentRelation = new Connection\Revision\DisableConsentRelation($connectionRevision, $remoteConnection); $em->persist($connectionDisableConsentRelation);
/** * @param Connection $connection * @param int $revisionNr * @param int|null $parentRevisionNr * @param string $revisionNote * @param string $state * @param DateTime $expirationDate * @param string|null $metadataUrl * @param bool $allowAllEntities * @param string $arpAttributes * @param null $manipulationCode * @param $isActive * @param null $notes * @param array $allowedConnections * @param array $blockedConnections * @param array $disableConsentConnections */ public function __construct(Connection $connection, $revisionNr, $parentRevisionNr = null, $revisionNote, $state, DateTime $expirationDate = null, $metadataUrl = null, $allowAllEntities, $arpAttributes, $manipulationCode = null, $isActive, $notes = null, array $allowedConnections = array(), array $blockedConnections = array(), array $disableConsentConnections = array()) { $this->connection = $connection; $this->name = $connection->getName(); $this->type = $connection->getType(); $this->revisionNr = $revisionNr; $this->parentRevisionNr = $parentRevisionNr; $this->state = $state; $this->expirationDate = $expirationDate; $this->metadataUrl = $metadataUrl; $this->allowAllEntities = $allowAllEntities; $this->arpAttributes = $arpAttributes; $this->manipulationCode = $manipulationCode; $this->isActive = $isActive; $this->notes = $notes; foreach ($allowedConnections as $allowedConnection) { $this->allowConnection($allowedConnection); } foreach ($blockedConnections as $blockedConnection) { $this->blockConnection($blockedConnection); } foreach ($disableConsentConnections as $disableConsentConnection) { $this->disableConsentForConnection($disableConsentConnection); } $this->setRevisionNote($revisionNote); }