accessoryBuilder = $this->loadService(AccessoryBuilder::class); } public function createAccessory(Producer $producer, string $name, ?int $quantity): Accessory { $accessory = $this->accessoryBuilder->instanciateAccessory($producer); $accessory->setName($name); $accessory->setQuantity($quantity); $accessory->save(); return $accessory; } }