是否可以使用Drupal api获取用户列表? [英] Is it possible to use the Drupal api to get a list of users?

查看:100
本文介绍了是否可以使用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模块允许您构建通过角色,权限等过滤的用户列表,但可以很容易地overkill。

The Views module allows you to build lists of users filtered by role, permission, etc -- but it could easily be overkill.

这篇关于是否可以使用Drupal api获取用户列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆