Get the list of all display IDs of a view

Hello All,

I’m doing some custom development involving the Views Class ( for a small project.

I’ve created a view programmatically, and it has a couple of displays, besides “default”: block_1 and page_1. It could have more displays in the future, it depends of the user’s requirements.

Is there any way to get the list of display IDs or titles programmatically? I know that this class has the methodView::getDisplay but it takes the ID of the Display, which I couldn’t know at this point.

This class also has the protected property View::$display, which stores all display handlers of this view. But it is a protected property, so I won’t be able to use it from my code.

Thanks in advance

Drupal version: