Hello !
On my application (e-commerce) I list the available products. For each
products I call a filter that modify the product price according to current
price campaign (if any campaign is active)
So for each products, I retrive the current campagne (SQL QUERY) :

$query = sprintf("SELECT %s AS campagneid FROM %s WHERE NOW() BETWEEN %s AND
%s LIMIT 1", AmaCampagnePeer::ID, AmaCampagnePeer::TABLE_NAME,
AmaCampagnePeer::DEBUT_VALIDITE, AmaCampagnePeer::FIN_VALIDITE);
$statement = $connection->prepare($query);
$statement->execute();
$campagneid = $statement->fetch(PDO::FETCH_OBJ);

But as soon as I get the current's campagn ID this is not going to change
during the current HTTP request ... so I don't have to execute this request
for each products... I want to use the same campagne ID for all the HTTP
request and not recalculate it each time I filter a product (to retrive the
campagne price) ... some kind of singleton design pattern .. but I don't
know exactly how to implement this (for example how do I know that I am I
the same HTTP request ?)
I don't know if i'm clear enougth ... :)

Thanks for your help, ideas, suggestions !!

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to