Changeset 2668


Ignore:
Timestamp:
May 12, 2012, 5:53:13 PM (8 years ago)
Author:
teymour
Message:

Diverses optimisations par Bastien Jaillot <http://bastnic.info/>

Location:
cpc/trunk/project
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cpc/trunk/project/apps/frontend/modules/section/actions/actions.class.php

    r2619 r2668  
    8989    $interventions = array();
    9090
    91     $inters = Doctrine_Query::create()
     91    $interventions = Doctrine_Query::create()
    9292      ->select('i.id')
    9393      ->from('Intervention i')
     
    9595      ->where('s.section_id = ?', $this->section->id)
    9696      ->andWhere('i.nb_mots > 20')
    97       ->fetchArray();   
    98     foreach($inters as $i) {
    99       $interventions[] = $i['id'];
    100     }
     97      ->execute(array(), Doctrine_Core::HYDRATE_SINGLE_SCALAR);
    10198
    10299    //    $this->forward404Unless(count($interventions));
    103      
     100
    104101    $this->qtag = Doctrine_Query::create()
    105102      ->from('Tagging tg, tg.Tag t');
  • cpc/trunk/project/apps/frontend/modules/tag/actions/components.class.php

    r1367 r2668  
    7676
    7777  public function executeGlobalActivite() {
    78     $inter = Doctrine::getTable('Intervention')->createQuery('i')
     78    $ids = Doctrine::getTable('Intervention')->createQuery('i')
     79      ->select('i.id')
    7980      ->orderBy('i.date DESC')
    80       ->limit(5000)->fetchArray();
    81     $ids = array();
    82     foreach($inter as $i) {
    83       $ids[] = $i['id'];
    84     }
     81      ->limit(5000)
     82      ->execute(array(), Doctrine_Core::HYDRATE_SINGLE_SCALAR);
     83//      ->fetchArray();
     84
    8585    $this->itag = Doctrine_Query::create()
    8686      ->from('Tagging tg, tg.Tag t')
  • cpc/trunk/project/lib/model/doctrine/Section.class.php

    r2414 r2668  
    4141  }
    4242  public function getFirstSeance() {
    43     $q = Doctrine_Query::create()
     43    return Doctrine_Query::create()
    4444      ->from('Seance s, Section st, Intervention i')
    4545      ->select('s.id')
     
    4848      ->andWhere('(st.section_id = ? OR i.section_id = ? )', array($this->id, $this->id))
    4949      ->groupBy('s.id')
    50       ->orderBy('st.min_date ASC, st.timestamp ASC')->fetchOne();
    51     return $q->id;
     50      ->orderBy('st.min_date ASC, st.timestamp ASC')
     51      ->limit(1)
     52      ->execute(array(), Doctrine_Core::HYDRATE_SINGLE_SCALAR);
    5253  }
    5354  public function getSeances() {
Note: See TracChangeset for help on using the changeset viewer.