Changeset 1330


Ignore:
Timestamp:
Sep 7, 2010, 12:43:31 AM (10 years ago)
Author:
teymour
Message:

Permettre la connexion avec solr pas totalement identique à la base locale

Location:
cpc/trunk/project
Files:
4 edited

Legend:

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

    r1327 r1330  
    8989      $res = $this->results['docs'][$i];
    9090      $obj = $res['object'];
     91
    9192      $this->results['docs'][$i]['link'] = $obj->getLink();
    9293      $this->results['docs'][$i]['photo'] = $this->getPhoto($obj);
  • cpc/trunk/project/lib/model/doctrine/Amendement.class.php

    r1327 r1330  
    1010    return url_for('@amendement?loi='.$this->texteloi_id.'&numero='.$this->numero);
    1111  }
    12   public function getPersonne($obj) {
     12  public function getPersonne() {
    1313    return '';
    1414  }
  • cpc/trunk/project/lib/model/doctrine/Commentaire.class.php

    r1327 r1330  
    1010  }
    1111  public function getPersonne() {
    12     return $this->citoyen->getLogin();
     12    return $this->getCitoyen()->getLogin();
    1313  }
    1414  public function getTitre() {
  • cpc/trunk/project/lib/model/solr/SolrConnector.class.php

    r1327 r1330  
    8585    $response = $this->solr->search($queryString, $offset, $maxHits, $params);
    8686    $results = unserialize($response->getRawResponse());
     87    $unset = array();
    8788    for ($i = 0 ; $i < count($results['response']['docs']); $i++) {
    8889      $res = $results['response']['docs'][$i];
    8990      $results['response']['docs'][$i]['object'] = Doctrine::getTable($res['object_name'])->find($res['object_id']);
     91      if (!$results['response']['docs'][$i]['object'])
     92        $unset[] = $i;
    9093    }
     94    foreach ($unset as $i) {
     95      unset($results['response']['docs'][$i]);
     96    }
     97    $results['response']['docs'] = array_values($results['response']['docs']);
    9198    return $results;
    9299  }
Note: See TracChangeset for help on using the changeset viewer.