/** * Initialize a new AssociationValueEntry for a saga with given <code>sagaIdentifier</code> and * <code>associationValue</code>. * * @param string $sagaType The type of Saga this association value belongs to * @param string $sagaIdentifier The identifier of the saga * @param AssociationValue $associationValue The association value for the saga */ public function __construct($sagaType, $sagaIdentifier, AssociationValue $associationValue) { $this->sagaType = $sagaType; $this->sagaId = $sagaIdentifier; $this->associationKey = $associationValue->getPropertyKey(); $this->associationValue = $associationValue->getPropertyValue(); }
protected function findAssociatedSagaIdentifiers($type, AssociationValue $associationValue) { $entries = $this->entityManager->createQuery("SELECT ae.sagaId FROM " . "Governor\\Framework\\Saga\\Repository\\Orm\\AssociationValueEntry ae " . "WHERE ae.associationKey = :associationKey " . "AND ae.associationValue = :associationValue " . "AND ae.sagaType = :sagaType")->setParameters(array(":associationKey" => $associationValue->getPropertyKey(), ":associationValue" => $associationValue->getPropertyValue(), ":sagaType" => $this->typeOf($type)))->getResult(); return array_map('current', $entries); }
private function associationValueQuery($type, AssociationValue $associationValue) { return ['sagaType' => $this->typeOf($type), 'associations' => ['key' => $associationValue->getPropertyKey(), 'value' => $associationValue->getPropertyValue()]]; }