/** * @param NewConnectionRevision $newRevision * @return ConnectionDto */ public function disassemble(NewConnectionRevision $newRevision) { $connection = $newRevision->getConnection(); $dto = new ConnectionDto(); $dto->revisionNote = $newRevision->getRevisionNote(); // The API will ignore this, but we send it anyway for easier debugging. $dto->revisionNr = $connection->getRevisionNr(); $dto->isActive = $connection->isActive(); $dto->name = $connection->getName(); $dto->id = $connection->getId(); $dto->state = $connection->getState(); $dto->type = $connection->getType(); $dto->metadataUrl = $connection->getMetadataUrl(); $dto->manipulationCode = $connection->getManipulationCode(); $dto->metadata = $this->expand($connection->getAllMetadata()); $dto->arpAttributes = $connection->getArpAttributes()->toArray(); $dto->disableConsentConnections = $this->disassembleReferences($connection->getConsentDisabledConnections()); $dto->allowedConnections = $this->disassembleReferences($connection->getAccess()->getAllowedConnections()); $dto->blockedConnections = $this->disassembleReferences($connection->getAccess()->getBlockedConnections()); $dto->allowAllEntities = $connection->getAccess()->isAllowAll(); $dto->createdAtDate = $connection->getCreatedDate()->format('c'); $dto->updatedAtDate = $connection->getUpdatedAtDate()->format('c'); return $dto; }