#15032 closed enhancement (wontfix)
WP_Object_Query
Reported by: | scribu | Owned by: | scribu |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | General | Keywords: | ongoing-project |
Focuses: | Cc: |
Description (last modified by )
There's a lot of overlap between WP_Query and WP_User_Query.
It would be good if they both inherited from a general WP_Object_Query, which would handle taxonomy and meta queries.
We could then more easily create a WP_Comment_Query class, for example, which would further reduce code duplication.
Attachments (1)
Change History (27)
#3
@
14 years ago
- Keywords has-patch added
- Milestone changed from Future Release to 3.1
- Owner set to scribu
- Status changed from new to accepted
#5
in reply to:
↑ description
;
follow-up:
↓ 7
@
14 years ago
Replying to scribu:
There's a lot of overlap between WP_Query and WP_User_Query.
It would be good if they both inherited from a general WP_Object_Query, which would handle taxonomy and meta queries.
I don't understand the point of the inheritance here. Usually, inheritance involves substantial properties or behavior to be inherited; here, WP_Object_Query
has two (private) methods and a property. There's nothing to speak of being inherited; there's no expected re-use of the private methods for any given object; its code re-use could easily be done with a couple of functions.
Also, the name is misleading. Both of WP_Object_Query
's methods and its one property have to do with the object's meta information, not the object proper.
#6
@
14 years ago
Also, shouldn't get_meta_sql
be named something like get_intersecting_meta_sql
or the like? Something like get_unioned_meta_sql
seems like the next logical, additional function or method.
#7
in reply to:
↑ 5
@
14 years ago
Replying to filosofo:
I don't understand the point of the inheritance here. Usually, inheritance involves substantial properties or behavior to be inherited; here,
WP_Object_Query
has two (private) methods and a property. There's nothing to speak of being inherited; there's no expected re-use of the private methods for any given object; its code re-use could easily be done with a couple of functions.
I plan to move _wp_search_sql() in it and also the taxonomy stuff, just for starters. You'll see. :)
#8
@
14 years ago
There is an @access protected
. The point of @access really is to tell what the visibility is of the method for PHP4 classes, which doesn't have the keywords to describe it. It is also useful to prevent it from being displayed on phpdocumentor web sites, but its values aren't only private and public.
#23
@
14 years ago
- Milestone 3.1 deleted
- Resolution set to wontfix
- Status changed from accepted to closed
(In [15715]) Introduce WP_Object_Query. See #15032