public function handle(CreateTextOptionCommand $command) { $textOption = new TextOption($command->getTextOptionId()); $textOption->setName($command->getName()); $textOption->setDescription($command->getDescription()); $textOption->setSortOrder($command->getSortOrder()); $textOption->setType($command->getTextOptionType()); $this->optionService->createTextOption($textOption); }
public function testCreate() { $textOptionType = $this->dummyData->getTextOptionType(); $tag = $this->dummyData->getTag(); $textOption = new TextOption(); $textOption->setType($textOptionType); $textOption->setName('Custom Message'); $textOption->setDescription('Custom engraved message'); $textOption->setSortOrder(2); $textOption->addTag($tag); $this->assertEntityValid($textOption); $this->assertSame($textOptionType, $textOption->getType()); $this->assertSame('Custom Message', $textOption->getName()); $this->assertSame('Custom engraved message', $textOption->getDescription()); $this->assertSame(2, $textOption->getSortOrder()); $this->assertSame($tag, $textOption->getTags()[0]); }
public function getTextOption() { $textOption = new TextOption(); $textOption->setName('Size'); $textOption->setType($this->getTextOptionType()); $textOption->setDescription('Shirt Size'); $textOption->setSortOrder(0); return $textOption; }