/**
  * @param TransactionId $transactionId
  * @return Transaction
  */
 public function transactionOfId(TransactionId $transactionId)
 {
     /** @var Result $result */
     $result = $this->repository->query()->where('id', '==', $transactionId->getValue())->execute();
     if ($result === false) {
         return null;
     }
     if ($result->count() == 0) {
         return null;
     }
     $encryptedTransaction = $this->documentToEncryptedTransaction($result->first());
     return $encryptedTransaction;
 }
コード例 #2
0
 /**
  * @param EncryptedTransaction $encryptedTransaction
  * @return bool
  */
 public function equals(EncryptedTransaction $encryptedTransaction)
 {
     if ($this->id->equals($encryptedTransaction->getId())) {
         return true;
     } else {
         return false;
     }
 }
コード例 #3
0
 /**
  * @return TransactionId
  * @throws \Exception
  */
 public function nextIdentity()
 {
     $id = strtoupper(str_replace('.', '', uniqid('', true)));
     return TransactionId::create($id);
 }