---
layout: docs
title: setProtected
id: trait.Facebook.HackCodegen.CodegenWithVisibility.setProtected
docid: trait.Facebook.HackCodegen.CodegenWithVisibility.setProtected
permalink: /docs/reference/trait.Facebook.HackCodegen.CodegenWithVisibility.setProtected/
---
# Facebook\\HackCodegen\\CodegenWithVisibility::setProtected()




``` Hack
public function setProtected(): this;
```




## Returns




+ ` this `