Commit 5c870dab authored by casey's avatar casey
Browse files

Issue #3308038 by casey: Use a loop instead of asserting a single timestamp entity

parent 04f8cf3e
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -136,12 +136,13 @@ class TimestampRepository implements TimestampRepositoryInterface {
  public function updateBlockchainInfo(string $remote_id, string $address, string $blockchain, string $transactionId, string $transactionLink) {
    /** @var \Drupal\wordproof\Entity\Timestamp $entity */
    $entities = $this->entityTypeManager->getStorage('wordproof_timestamp')->loadByProperties(['remote_id' => (int) $remote_id]);
    $entity = array_shift($entities);
    foreach ($entities as $entity) {
      $entity->setTransactionAddress($address);
      $entity->setTransactionBlockchain($blockchain);
      $entity->setTransactionId($transactionId);
      $entity->setTransactionLink($transactionLink);
      $entity->save();
    }
  }

}