Changeset 2597


Ignore:
Timestamp:
Jan 10, 2012, 11:04:20 AM (8 years ago)
Author:
goya
Message:

404 si le slug ne correspond pas à un député

File:
1 edited

Legend:

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

    r2594 r2597  
    146146    $this->forward404Unless($slug);
    147147    $depute = Doctrine::getTable('Parlementaire')->findOneBySlug($slug);
     148    $this->forward404Unless($depute);
    148149    $this->res = array();
    149150    $this->res['depute'] = $this->getParlementaireArray($depute);
     
    164165  public static function getParlementaireArray($parl) {
    165166    $res = array();
     167    if (!$parl)
     168        throw new Exception("pas de parlementaire");
    166169    $res['id'] = $parl->id * 1;
    167170    $res['nom'] = $parl->nom;
Note: See TracChangeset for help on using the changeset viewer.