Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-catalog
Model
Category
Product
PositionResolver.php
Go to the documentation of this file.
1
<?php
6
declare(strict_types=1);
7
8
namespace
Magento\Catalog\Model\Category\Product
;
9
13
class
PositionResolver
extends
\Magento\Framework\Model\ResourceModel\Db\AbstractDb
14
{
20
protected
function
_construct
()
21
{
22
$this->
_init
(
'catalog_product_entity'
,
'entity_id'
);
23
}
24
31
public
function
getPositions
(
int
$categoryId): array
32
{
33
$connection
= $this->
getConnection
();
34
35
$select
=
$connection
->select()->from(
36
[
'cpe'
=> $this->
getTable
(
'catalog_product_entity'
)],
37
'entity_id'
38
)->joinLeft(
39
[
'ccp'
=> $this->
getTable
(
'catalog_category_product'
)],
40
'ccp.product_id=cpe.entity_id'
41
)->where(
42
'ccp.category_id = ?'
,
43
$categoryId
44
)->order(
45
'ccp.position '
. \
Magento
\Framework\DB\
Select::SQL_ASC
46
);
47
48
return
array_flip(
$connection
->fetchCol(
$select
));
49
}
50
}
Magento\Catalog\Model\Category\Product
Definition:
PositionResolver.php:8
Magento\Catalog\Model\Category\Product\PositionResolver\getPositions
getPositions(int $categoryId)
Definition:
PositionResolver.php:31
Magento\Framework\Model\ResourceModel\Db\AbstractDb\_init
_init($mainTable, $idFieldName)
Definition:
AbstractDb.php:186
Magento\Catalog\Model\Category\Product\PositionResolver
Definition:
PositionResolver.php:13
$select
$select
Definition:
catalog_rule_10_off_not_logged_rollback.php:14
Magento\Framework\Model\ResourceModel\Db\AbstractDb\getTable
getTable($tableName)
Definition:
AbstractDb.php:279
Magento
Magento\Catalog\Model\Category\Product\PositionResolver\_construct
_construct()
Definition:
PositionResolver.php:20
Magento\Framework\Model\ResourceModel\Db\AbstractDb
Definition:
AbstractDb.php:24
$connection
$connection
Definition:
bulk.php:13
Magento\Framework\Model\ResourceModel\Db\AbstractDb\getConnection
getConnection()
Definition:
AbstractDb.php:325
Zend_Db_Select\SQL_ASC
const SQL_ASC
Definition:
Select.php:81