コード例 #1
0
 /**
  * Asserts that <em>no</em> association is present for the given <code>associationKey</code> and
  * <code>associationValue</code>.
  *
  * @param string $associationKey The key of the association
  * @param string $associationValue The value of the association
  * @throws GovernorAssertionError
  */
 public function assertNoAssociationPresent($associationKey, $associationValue)
 {
     $associatedSagas = $this->sagaRepository->find($this->sagaType, new AssociationValue($associationKey, $associationValue));
     if (!empty($associatedSagas)) {
         throw new GovernorAssertionError(sprintf("Expected a saga to be associated with key:<%s> value:<%s>, but found <%s>", $associationKey, $associationValue));
     }
 }
コード例 #2
0
 private function repositoryContents($lookupValue, $sagaType)
 {
     $identifiers = $this->sagaRepository->find($sagaType, new AssociationValue("myIdentifier", $lookupValue));
     $sagas = array();
     foreach ($identifiers as $identifier) {
         $sagas[] = $this->sagaRepository->load($identifier);
     }
     return $sagas;
 }