Log in
Interface

CategoryTreeInterface

Magento\Catalog\Api\Data\CategoryTreeInterface

What it does

This interface defines the data structure for representing categories in a hierarchical tree format within Magento 2.

Developers use it when working with category trees through APIs, enabling retrieval and manipulation of category hierarchies including parent-child relationships, category properties like name and position, and product counts.

It's particularly useful for building category navigation menus or retrieving nested category structures via web services.

Public Methods

  • getId()
  • setId()
  • getParentId()
  • setParentId()
  • getName()
  • setName()
  • getIsActive()
  • setIsActive()
  • getPosition()
  • setPosition()
  • getLevel()
  • setLevel()
  • getProductCount()
  • setProductCount()
  • getChildrenData()
  • setChildrenData()