Bonjour à tous,
J'ai un léger petit souci avec symfony qui me fait 60 requêtes pour
une simple pages.
Débutant avec ce framework je ne sais pas bien comment résoudre le
problème.
Alors voila ce que je fait :
dans mes action je fait :
$this->redirect = Doctrine::getTable('Redirect')->retrieveRedirectFrom
($this->id);
 et la methode qui vas avec :
        public function retrieveRedirectFrom($id)
        {
                $q = Doctrine_Query::create()
                ->select('r.id, r.id_user, df.name, dt.name,
                r.id_domain_to, r.id_domain_from, r.id_httptype, 
r.modified_date,
r.rank')
                ->from('Redirect r')
                ->leftJoin('r.RedirectFrom df')
                ->leftJoin('r.RedirectTo dt')
                ->where('r.id_domain_from = ?', $id );
                return $q->execute();
        }
et le logs :
sept. 09 16:21:27 symfony [info] {sfDoctrineLogger} executeQuery :
SELECT r.id AS r__id, r.id_user AS r__id_user, r.query_from AS
r__query_from, r.query_to AS r__query_to, r.id_domain_to AS
r__id_domain_to, r.id_domain_from AS r__id_domain_from, r.id_httptype
AS r__id_httptype, r.modified_date AS r__modified_date, r.rank AS
r__rank FROM redirect r WHERE r.id = ? LIMIT 1 - (1 )
sept. 09 16:21:27 symfony [info] {sfDoctrineLogger} executeQuery :
SELECT h.http_code AS h__http_code, h.name AS h__name FROM http_type h
WHERE h.http_code = ? - (301 )
sept. 09 16:21:27 symfony [info] {sfDoctrineLogger} executeQuery :
SELECT h.http_code AS h__http_code, h.name AS h__name FROM http_type h
WHERE h.http_code = ? - (301 )
sept. 09 16:21:27 symfony [info] {sfDoctrineLogger} executeQuery :
SELECT r.id AS r__id, r.id_user AS r__id_user, r.query_from AS
r__query_from, r.query_to AS r__query_to, r.id_domain_to AS
r__id_domain_to, r.id_domain_from AS r__id_domain_from, r.id_httptype
AS r__id_httptype, r.modified_date AS r__modified_date, r.rank AS
r__rank FROM redirect r WHERE r.id = ? LIMIT 1 - (3 )
...
...
...
...
sept. 09 16:21:28 symfony [info] {sfDoctrineLogger} executeQuery :
SELECT h.http_code AS h__http_code, h.name AS h__name FROM http_type h
WHERE h.http_code = ? - (301 )

Grossomodo il fait 2 requêtes par ligne affiché.
Comment puis-je corriger cela ?

--~--~---------~--~----~------------~-------~--~----~
Vous avez reçu ce message, car vous êtes abonné au groupe Groupe "Symfony-fr" 
de Google Groupes.
 Pour transmettre des messages à ce groupe, envoyez un e-mail à 
l'adresse [email protected]
 Pour résilier votre abonnement à ce groupe, envoyez un e-mail à 
l'adresse [email protected]
 Pour afficher d'autres options, visitez ce groupe à l'adresse 
http://groups.google.com/group/symfony-fr?hl=fr
-~----------~----~----~----~------~----~------~--~---

Répondre à