---
layout: docs
title: __construct
id: class.Facebook.HackCodegen.CodegenEnum.__construct
docid: class.Facebook.HackCodegen.CodegenEnum.__construct
permalink: /docs/reference/class.Facebook.HackCodegen.CodegenEnum.__construct/
---
# Facebook\\HackCodegen\\CodegenEnum::__construct()




Create an instance




``` Hack
public function __construct(
  Facebook\HackCodegen\IHackCodegenConfig $config,
  string $name,
  string $enumType,
);
```




You should use ` ICodegenFactory::codegenEnum ` instead  of directly
constructing.




## Parameters




- [` Facebook\HackCodegen\IHackCodegenConfig `](<interface.Facebook.HackCodegen.IHackCodegenConfig.md>)`` $config ``
- ` string $name `
- ` string $enumType `