gpt4 book ai didi

mysql - 实体字段查询中的多个实体类型

转载 作者:行者123 更新时间:2023-12-01 00:43:42 25 4
gpt4 key购买 nike

如何在 EntityFieldQuery 中添加多个 entity_type 和 bundle?

$query->entityCondition('entity_type', 'profile2')
->entityCondition('bundle', 'user_profile');

有什么办法可以做到这一点吗?

$query->entityCondition('entity_type', array('profile2','user'))
->entityCondition('bundle', array('user_profile','property'));

最佳答案

这是不可能的:https://api.drupal.org/api/drupal/includes%21entity.inc/class/EntityFieldQuery/7

This class allows finding entities based on entity properties (for example, node->changed), field values, and generic entity meta data (bundle, entity type, entity id, and revision ID). It is not possible to query across multiple entity types. For example, there is no facility to find published nodes written by users created in the last hour, as this would require querying both node->status and user->created.

关于mysql - 实体字段查询中的多个实体类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25681367/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com