Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Protected Attributes | |
$_storeId | |
$_loaded = false | |
$_nodes = [] | |
$_inactiveCategoryIds | |
$_eventManager | |
$_catalogConfig | |
$_storeManager | |
$_categoryCollectionFactory | |
$_categoryFactory | |
![]() | |
$tableStrategy | |
![]() | |
$_resources | |
$connectionName = \Magento\Framework\App\ResourceConnection::DEFAULT_CONNECTION | |
$_connections = [] | |
$_resourceModel | |
$_tables = [] | |
$_mainTable | |
$_idFieldName | |
$_isPkAutoIncrement = true | |
$_useIsObjectNew = false | |
$_mainTableFields | |
$_uniqueFields = null | |
$_serializableFields = [] | |
$transactionManager | |
$objectRelationProcessor | |
![]() | |
$serializer | |
$_logger | |
Category flat model
@SuppressWarnings(PHPMD.LongVariable) @SuppressWarnings(PHPMD.CouplingBetweenObjects)
__construct | ( | \Magento\Framework\Model\ResourceModel\Db\Context | $context, |
\Magento\Framework\Indexer\Table\StrategyInterface | $tableStrategy, | ||
\Magento\Catalog\Model\CategoryFactory | $categoryFactory, | ||
\Magento\Catalog\Model\ResourceModel\Category\CollectionFactory | $categoryCollectionFactory, | ||
\Magento\Store\Model\StoreManagerInterface | $storeManager, | ||
\Magento\Catalog\Model\Config | $catalogConfig, | ||
\Magento\Framework\Event\ManagerInterface | $eventManager, | ||
$connectionName = null , |
|||
\Magento\Catalog\Model\ResourceModel\Category\Flat\CollectionFactory | $categoryFlatCollectionFactory = null |
||
) |
Constructor
\Magento\Framework\Model\ResourceModel\Db\Context | $context | |
\Magento\Framework\Indexer\Table\StrategyInterface | $tableStrategy | |
\Magento\Catalog\Model\CategoryFactory | $categoryFactory | |
CollectionFactory | $categoryCollectionFactory | |
\Magento\Store\Model\StoreManagerInterface | $storeManager | |
\Magento\Catalog\Model\Config | $catalogConfig | |
\Magento\Framework\Event\ManagerInterface | $eventManager | |
string | $connectionName | |
\Magento\Catalog\Model\ResourceModel\Category\Flat\CollectionFactory | null | $categoryFlatCollectionFactory |
Definition at line 101 of file Flat.php.
|
protected |
Resource initializations
Definition at line 127 of file Flat.php.
|
protected |
|
protected |
Load nodes by parent id
\Magento\Catalog\Model\Category | int | $parentNode | |
integer | $recursionLevel | |
integer | $storeId | |
bool | $skipMenuFilter |
Definition at line 239 of file Flat.php.
addChildNodes | ( | $children, | |
$path, | |||
$parent | |||
) |
Creating sorted array of nodes
array | $children | |
string | $path | |
\Magento\Framework\DataObject | $parent |
Definition at line 321 of file Flat.php.
addInactiveCategoryIds | ( | $ids | ) |
Add inactive categories ids
array | $ids |
Definition at line 195 of file Flat.php.
checkId | ( | $id | ) |
Check if category id exist
int | $id |
Definition at line 655 of file Flat.php.
getAllChildren | ( | $category | ) |
Return all children ids of category (with category id)
\Magento\Catalog\Model\Category | $category |
Definition at line 640 of file Flat.php.
getAnchorsAbove | ( | array | $filterIds, |
$storeId = 0 |
|||
) |
Retrieve anchors above
array | $filterIds | |
int | $storeId |
Definition at line 674 of file Flat.php.
getAttribute | ( | $attribute | ) |
Retrieve attribute instance
Special for non static flat table.
mixed | $attribute |
Definition at line 461 of file Flat.php.
getCategories | ( | $parent, | |
$recursionLevel = 0 , |
|||
$sorted = false , |
|||
$asCollection = false , |
|||
$toLoad = true |
|||
) |
Return array or collection of categories
integer | $parent | |
integer | $recursionLevel | |
boolean | string | $sorted | |
boolean | $asCollection | |
boolean | $toLoad |
Definition at line 401 of file Flat.php.
getChildren | ( | $category, | |
$recursive = true , |
|||
$isActive = true , |
|||
$sortByPosition = false |
|||
) |
Return children ids of category
\Magento\Catalog\Model\Category | $category | |
bool | $recursive | |
bool | $isActive | |
bool | $sortByPosition |
Definition at line 608 of file Flat.php.
getChildrenAmount | ( | $category, | |
$isActiveFlag = true |
|||
) |
Get count of active/not active children categories
\Magento\Catalog\Model\Category | $category | |
bool | $isActiveFlag |
Definition at line 473 of file Flat.php.
getChildrenCategories | ( | $category | ) |
Return children categories of category
\Magento\Catalog\Model\Category | $category |
Definition at line 581 of file Flat.php.
getInactiveCategoryIds | ( | ) |
Retrieve inactive categories ids
Definition at line 221 of file Flat.php.
getMainStoreTable | ( | $storeId = \Magento\Store\Model\Store::DEFAULT_STORE_ID | ) |
Return name of table for given $storeId.
integer | $storeId |
Definition at line 173 of file Flat.php.
getMainTable | ( | ) |
Get main table name
Definition at line 162 of file Flat.php.
getNodeById | ( | $nodeId, | |
$nodes = null |
|||
) |
Return node with id $nodeId
integer | $nodeId | |
array | $nodes |
Definition at line 437 of file Flat.php.
getNodes | ( | $parentId, | |
$recursionLevel = 0 , |
|||
$storeId = 0 |
|||
) |
Return sorted array of nodes
integer | null | $parentId | |
integer | $recursionLevel | |
integer | $storeId |
Definition at line 357 of file Flat.php.
getParentCategories | ( | $category, | |
$isActive = true |
|||
) |
Return parent categories of category
\Magento\Catalog\Model\Category | $category | |
bool | $isActive |
Definition at line 516 of file Flat.php.
getParentDesignCategory | ( | $category | ) |
Return parent category of current category with own custom design settings
\Magento\Catalog\Model\Category | $category |
Definition at line 551 of file Flat.php.
getProductCount | ( | $category | ) |
Get products count in category
\Magento\Catalog\Model\Category | $category |
Definition at line 495 of file Flat.php.
getProductsPosition | ( | $category | ) |
Get positions of associated to category products
\Magento\Catalog\Model\Category | $category |
Definition at line 696 of file Flat.php.
isInRootCategoryList | ( | $category | ) |
setStoreId | ( | $storeId | ) |