Exemplo n.º 1
0
 /**
  * @param AssociationValue $associationValue
  * @return bool
  */
 public function contains(AssociationValue $associationValue) : bool
 {
     /* @var $item AssociationValue */
     foreach ($this->items as $item) {
         if ($item->getKey() === $associationValue->getKey()) {
             return true;
         }
     }
     return false;
 }
Exemplo n.º 2
0
 /**
  * @param string $sagaType
  * @param AssociationValue $associationValue
  * @return Identity[]
  */
 public function find(string $sagaType, AssociationValue $associationValue) : array
 {
     return array_map(function (string $sagaId) : Identity {
         return Identity::fromString($sagaId);
     }, $this->storage->find($sagaType, [$associationValue->getKey() => $associationValue->getValue()]));
 }