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




Set the parent class of the generated class




``` Hack
public function setExtends(
  string $name,
): this;
```




## Parameters




- ` string $name `




## Returns




+ ` this `