Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document how to use egef_metadata/relationships() to get entities without specified MD/relationship. (Trac #3046) #3046

Closed
elgg-gitbot opened this issue Feb 16, 2013 · 8 comments
Labels
Milestone

Comments

@elgg-gitbot
Copy link

Original ticket http://trac.elgg.org/ticket/3046 on 41181991-06-11 by trac user jtilson, assigned to unknown.

Elgg version: 1.7

It would be great if we had a function that could grab entities without a particular set of metadata, or entities that don't have a given relationship. While it's understood that this can be achieved by using custom joins and wheres, it'd be even nicer if there was a wrapper function for these situations.

@elgg-gitbot
Copy link
Author

cash wrote on 41418362-05-04

Easy to do but will it be used by enough people to justify the addition of at least four functions (entities, relationships, metadata, annotations)? Feedback welcome from anyone on this.

@elgg-gitbot
Copy link
Author

ewinslow wrote on 41500311-06-12

I think it'd be better for now to just write up some documentation on what the SQL clauses should be for those who want to acheive this. I'd certainly like to know!

@elgg-gitbot
Copy link
Author

brettp wrote on 41502173-04-25

Metadata (denormalize in code to make your life easier):

    $options['wheres'][] = "NOT EXISTS (
            SELECT 1 FROM {$dbprefix}metadata md
            WHERE md.entity_guid = e.guid
                AND md.name_id = $name_metastring_id
                AND md.value_id = $value_metastring_id)";

Relationships:

    $options['wheres'][] = "NOT EXISTS (
            SELECT 1 FROM {$db_prefix}entity_relationships
                WHERE guid_one = e.guid
                AND relationship = '$relationship'
        )";

@elgg-gitbot
Copy link
Author

brettp wrote on 42321985-08-31

I don't think there's enough of a use case to merit adding the new functions. Documentation above egef_metadata() and egef_relationship() should suffice.

@elgg-gitbot
Copy link
Author

Milestone changed to Elgg 1.8.5 by brettp on 42321985-08-31

@elgg-gitbot
Copy link
Author

Title changed from elgg_get_entities_without_* wrapper function to Document how to use egef_metadata/relationships() to get entities without specified MD/relationship. by brettp on 42321985-08-31

@elgg-gitbot
Copy link
Author

trac user Cash Costello wrote on 42516005-09-25

Fixes #3046 adds documentation for requesting entities that do not have metadata or relationships
Changeset: e9df078

@elgg-gitbot
Copy link
Author

trac user Cash Costello wrote on 42524624-10-26

Fixes #3046 adds documentation for requesting entities that do not have metadata or relationships
Changeset: e9df078

adayth pushed a commit to adayth/Elgg that referenced this issue Feb 22, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant