modResource.getGroupsList
Последнее обновление not available | История страницы | Улучшить эту страницу | Сообщить о проблеме
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$194 per month—let's make that $500!
Learn moremodResource.getGroupsList¶
Возвращает collection всех групп ресурсов в системе и total для постраничной навигации — из статического listGroups(). У каждой группы есть поле access: 1, если ресурс в неё входит, и 0 в противном случае.
Синтаксис¶
array getGroupsList ([array $sort = array('id' => 'ASC') [, int $limit = 0 [, int $offset = 0]]])
-
$sort(array) столбцы сортировки в форматеcolumn => direction, по умолчаниюarray('id' => 'ASC') -
$limit(int) максимум возвращаемых строк,0отключает ограничение, по умолчанию0 -
$offset(int) смещение строк для ограниченной выборки, по умолчанию0
Пример¶
$resource = $modx->getObject('modResource', array('id' => 5));
$result = $resource->getGroupsList(array('name' => 'ASC'), 20, 0);
foreach ($result['collection'] as $group) {
echo $group->get('name') . ': ' . $group->get('access');
}
Смотрите также¶
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$194 per month—let's make that $500!
Learn more










