示例#1
0
 /**
  * Chargement de a liste des activités pour un code
  *
  * @param string $code    Code CCAM
  * @param array  $exclude Liste des activités à exclure
  *
  * @return self[] Liste des activités
  */
 static function loadListFromCode($code, $exclude = array())
 {
     $ds = self::$spec->ds;
     $exclude_list = "";
     if (count($exclude)) {
         $exclude_list = "AND p_activite.ACTIVITE NOT IN (" . implode(",", $exclude) . ")";
     }
     $query = "SELECT p_activite.*\n      FROM p_activite\n      WHERE p_activite.CODEACTE = %\n        {$exclude_list}\n      ORDER BY p_activite.ACTIVITE ASC";
     $query = $ds->prepare($query, $code);
     $result = $ds->exec($query);
     $list_activites = array();
     while ($row = $ds->fetchArray($result)) {
         $activite = new CActiviteCCAM();
         $activite->_code = $code;
         $activite->map($row);
         $list_activites[$row["ACTIVITE"]] = $activite;
     }
     return $list_activites;
 }
示例#2
0
 /**
  * Chargement des activités de l'acte
  * Table p_activite
  *
  * @return CActiviteCCAM[] La liste des activités
  */
 function loadRefActivites()
 {
     $exclude = array();
     if ($this->arborescence[1]["db"] == "000018" && $this->arborescence[2]["db"] == "000001") {
         $exclude[] = "'1'";
     }
     return $this->_ref_activites = CActiviteCCAM::loadListFromCode($this->code, $exclude);
 }