Is it possible to use the Drupal api to get a list of users?(是否可以使用 Drupal api 来获取用户列表?)
问题描述
我想获取已分配特定角色的所有用户的列表.我可以编写自己的 SQL,但我想尽可能多地使用 api.
I would like to get a list of all the users who have been assigned a certain role. I could write my own SQL but I would like to use the api as much as possible.
推荐答案
对于此类任务(提取符合特定条件的实体),通常没有 Drupal API 函数.它倾向于关注 API 中的单实体 CRUD 功能;其他一切都取决于开发人员自己的 SQL 技能.
There are generally no Drupal API functions for this sort of task (pulling up entities that match certain criteria). It tends to focus on single-entity CRUD functions in the API; everything else is up to a developer's own SQL skills.
Views 模块允许您构建按角色、权限等过滤的用户列表 - 但它很容易被过度使用.
The Views module allows you to build lists of users filtered by role, permission, etc -- but it could easily be overkill.
这篇关于是否可以使用 Drupal api 来获取用户列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:是否可以使用 Drupal api 来获取用户列表?


- 如何使用 Google API 在团队云端硬盘中创建文件夹? 2022-01-01
- Oracle 即时客户端 DYLD_LIBRARY_PATH 错误 2022-01-01
- 如何从数据库中获取数据以在 laravel 中查看页面? 2022-01-01
- Laravel 5:Model.php 中的 MassAssignmentException 2021-01-01
- 覆盖 Magento 社区模块控制器的问题 2022-01-01
- 使用 GD 和 libjpeg 支持编译 PHP 2022-01-01
- PHP - if 语句中的倒序 2021-01-01
- openssl_digest vs hash vs hash_hmac?盐与盐的区别HMAC? 2022-01-01
- 如何在 Symfony2 中正确使用 webSockets 2021-01-01
- PHP foreach() 与数组中的数组? 2022-01-01