protected function getChronologicEventIterator(AggregateRootTypeInterface $aggregate_root_type)
 {
     $service_locator = $this->getContext()->getServiceLocator();
     $data_access_service = $service_locator->getDataAccessService();
     $reader_key = sprintf('%s::domain_event::event_source::reader', $aggregate_root_type->getPrefix());
     return $data_access_service->getStorageReader($reader_key);
 }
예제 #2
0
 protected function createWorkflowActivity(AggregateRootTypeInterface $aggregate_root_type, $workflow_event)
 {
     $write_events = $this->service_locator->getWorkflowService()->getWriteEventNames();
     if (in_array($workflow_event, $write_events)) {
         $request_method = 'write';
         $activity_route = $aggregate_root_type->getPrefix() . '.resource.task.proceed';
     } else {
         $request_method = 'read';
         $activity_route = $aggregate_root_type->getPrefix() . '.resource.task';
     }
     return new Activity(['name' => $workflow_event, 'scope' => $aggregate_root_type->getPrefix(), 'label' => sprintf('%s.label', $workflow_event), 'type' => Activity::TYPE_WORKFLOW, 'description' => sprintf('%s.description', $workflow_event), 'verb' => $request_method, 'rels' => [$workflow_event, sprintf('%s_resource', $workflow_event)], 'settings' => new Settings(['form_id' => 'randomId-' . rand()]), 'url' => new Url(['type' => Url::TYPE_ROUTE, 'value' => $activity_route, 'parameters' => ['event' => $workflow_event]])]);
 }
예제 #3
0
 public function getByAggregateRootType(AggregateRootTypeInterface $aggregate_root_type, $variant = ProjectionTypeInterface::DEFAULT_VARIANT)
 {
     return $this->getItem(sprintf('%s::projection.%s', $aggregate_root_type->getPrefix(), StringToolkit::asSnakeCase($variant)));
 }
예제 #4
0
 /**
  * @dataProvider provideDefaultAttributeFixture
  */
 public function testGetAttributes(AggregateRootTypeInterface $aggregate_root_type, array $expected_attribute_names)
 {
     $actual_attribute_names = $aggregate_root_type->getAttributes()->getKeys();
     $this->assertEquals($expected_attribute_names, $actual_attribute_names);
 }
예제 #5
0
 /**
  * Create a fresh aggregate-root instance.
  *
  * @return AggregateRootInterface
  */
 public function create()
 {
     $aggregate_root = $this->aggregate_root_type->createEntity();
     $this->startTracking($aggregate_root);
     return $aggregate_root;
 }