Exclude entities which don't have specific value with EntityFieldQuery

Let's say I have entityreference field in my content type which could have unlimited number of values. How to query for entities which doesn't have specific reference in this field.

$query->fieldCondition('field_related_posts', 'target_id', $post_id, '<>'); 

This query will return entities with such reference because there are other values which are not equal to this $post_id.

Replay

Category: 7 Time: 2016-07-28 Views: 1

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.139 (s). 12 q(s)