/** * @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; }
/** * @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()])); }