/** * @return Definition */ public function createDefinition() { $this->entityDefinition->setNewCommandHandler(new NewCommandHandlerMock()); $this->entityDefinition->setEditCommandHandler(new EditCommandHandlerMock()); $this->entityDefinition->setRemoveCommandHandler(new RemoveCommandHandlerMock()); return $this->entityDefinition; }
/** * @return Definition */ public function createDefinition() { $definition = new Definition(new ClassName(Recipe::class), new Definition\Identity("name"), new IdentificationStrategy($this->storage)); $definition->setObserved([new Definition\Property("steps"), new Definition\Property("publicationDate"), new Definition\Property("description")]); $definition->setEditCommandHandler(new EditCommandHandler($this->storage, $this->searchEngine)); $definition->setNewCommandHandler(new NewCommandHandler($this->storage, $this->searchEngine)); $definition->setRemoveCommandHandler(new RemoveCommandHandler($this->storage, $this->searchEngine)); return $definition; }
/** * @return \Isolate\UnitOfWork\Entity\Definition */ private function createFakeEntityDefinition() { $definition = new Definition(new ClassName(EntityFake::getClassName()), new Identity("id")); $definition->setObserved([new Property("firstName"), new Property("lastName"), new Property("items")]); $definition->setNewCommandHandler($this->newCommandHandler); $definition->setEditCommandHandler($this->editCommandHandler); $definition->setRemoveCommandHandler($this->removeCommandHandler); return $definition; }