Hi,
First, I apologize for my approximate English and I hope you will
understand me!
I have a problem with sfPager and sfPropelActAsTaggableBehaviorPlugin.
I want to retrieve all of items tagged by a keyword. For this, I use
the following code:
$pager = new sfPropelPager('Item', 10);
$c = TagPeer::getTaggedWithCriteria('UserItem', $this-
>getRequestParameter('tag'));
$c->addDescendingOrderByColumn(ItemPeer::CREATED_AT);
$c->setDistinct(true);
$pager->setCriteria($c);
$pager->setPage($this->getRequestParameter('page', 1));
$pager->setPeerMethod('doSelect');
$pager->init();
$this->items = $pager;
The debug toolbar display 3 queries :
- SELECT sf_tagging.TAGGABLE_MODEL, sf_tagging.TAGGABLE_ID FROM
sf_tagging, sf_tag WHERE sf_tag.NAME IN ('optimisation') AND
sf_tagging.TAGGABLE_MODEL='UserItem' AND sf_tag.ID=sf_tagging.TAG_ID
GROUP BY sf_tagging.TAGGABLE_ID HAVING COUNT(sf_tag.ID)>='1'
- SELECT DISTINCT COUNT(DISTINCT item.ID) FROM item, user_item WHERE
user_item.ID IN (1)
- SELECT DISTINCT item.ID, item.NAME, item.URI, item.SCREENSHOT,
item.DESCRIPTION, item.CREATED_AT FROM item, user_item WHERE
user_item.ID IN (1) ORDER BY item.CREATED_AT DESC LIMIT 10
But, the first two queries are true but not the third : it retrieve
all of items in the database. I think that the problem in here: "IN
(1)".
Have you any idea to help me?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---