ezsystems / eztags

GNU General Public License v2.0
40 stars 40 forks source link

Updates the getRelatedObjectsCount method. Seemed like the method was a ... #40

Closed harmstyler closed 12 years ago

harmstyler commented 12 years ago

...bit overkill for what needed to be done. Also, this way we count what was actually returned in the getRelatedObjects method.

emodric commented 12 years ago

Hi Tyler,

actually, it was done this way on purpose. The way it is now, it does return the count which is the same as count of getRelatedObjects because it's the same query, with difference that it uses COUNT aggregate.

Besides that, the way it is now is faster. If you would notice, getRelatedObjects at the end fetches the actual objects from the database with eZContentObject::fetchIDArray(), which I wanted to avoid when fetching the count.

harmstyler commented 12 years ago

Alright, cool. I just updated my local to reflect your code. I am actually running an older version of ez tags and had added this myself, and when I was going to share it I saw you already had it in there as well.