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-authorization
Model
ResourceModel
Rules
Collection.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Authorization\Model\ResourceModel\Rules
;
7
14
class
Collection
extends
\Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection
15
{
21
protected
function
_construct
()
22
{
23
$this->
_init
(
24
\
Magento
\Authorization\Model\Rules::class,
25
\
Magento
\Authorization\Model\
ResourceModel
\Rules::class
26
);
27
}
28
35
public
function
getByRoles
(
$roleId
)
36
{
37
$this->
addFieldToFilter
(
'role_id'
, (
int
)
$roleId
);
38
return
$this;
39
}
40
46
public
function
addSortByLength
()
47
{
48
$length = $this->
getConnection
()->getLengthSql(
'{{resource_id}}'
);
49
$this->
addExpressionFieldToSelect
(
'length'
, $length,
'resource_id'
);
50
$this->
getSelect
()->order(
'length '
. \
Magento
\Framework\DB\Select::SQL_DESC);
51
52
return
$this;
53
}
54
}
Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection\addExpressionFieldToSelect
addExpressionFieldToSelect($alias, $expression, $fields)
Definition:
AbstractCollection.php:338
Magento\Catalog\Model\ResourceModel\Product
Definition:
CollectionTest.php:6
Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection
Definition:
AbstractCollection.php:19
Magento\Authorization\Model\ResourceModel\Rules\Collection\_construct
_construct()
Definition:
Collection.php:21
Magento\Framework\App\ResourceConnection\SourceProviderInterface\addFieldToFilter
addFieldToFilter($attribute, $condition=null)
Magento\Framework\Data\Collection\AbstractDb\getConnection
getConnection()
Definition:
AbstractDb.php:207
$roleId
$roleId
Definition:
webapi_user.php:22
Magento
Magento\Authorization\Model\ResourceModel\Rules\Collection\getByRoles
getByRoles($roleId)
Definition:
Collection.php:35
Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection\_init
_init($model, $resourceModel)
Definition:
AbstractCollection.php:401
Magento\Authorization\Model\ResourceModel\Rules
Definition:
CollectionTest.php:6
Magento\Authorization\Model\ResourceModel\Rules\Collection
Definition:
Collection.php:14
Magento\Authorization\Model\ResourceModel\Rules\Collection\addSortByLength
addSortByLength()
Definition:
Collection.php:46
Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection\getSelect
getSelect()
Definition:
AbstractCollection.php:187