715,6 → 715,8 |
} |
|
static function baseflor_ligne($obs, &$ligne) { |
// Attention la fonction suppose que l'on ait fait appel à baseflor_preload avant |
// d'être appelée |
if(! $obs['nom_ret_nn']) { |
$ligne = array_merge($ligne, array_fill(0, count(self::$baseflor_col), NULL)); |
return; |
727,6 → 729,10 |
|
list($referentiel) = explode(':', strtolower($obs['nom_referentiel'])); |
$cache_id = $referentiel . '-' . $obs['nom_ret_nn']; |
|
//echo $cache_id; |
//echo '<pre>'.print_r(self::$cache['getBaseflor'], true).'</pre>'; |
//exit; |
|
// XXX: problème de valeurs NULL pour utiliser simplement isset() ? |
// @ car getBaseflor[] n'est peut-être pas encore initialisé |
733,23 → 739,10 |
if(@array_key_exists($cache_id, self::$cache['getBaseflor'])) { |
$ligne = array_merge($ligne, self::$cache['getBaseflor'][$cache_id]); |
return; |
} |
|
// pas de cache: |
$data = Cel::db()->requeterLigne(sprintf("SELECT %s FROM cel_references " . |
"WHERE referentiel = '%s' AND num_nom_retenu = %d LIMIT 1", |
implode(', ', array_keys(self::$baseflor_col)), |
$referentiel, |
$obs['nom_ret_nn'])); |
|
if(! $data) { |
} else { |
$ligne = array_merge($ligne, array_fill(0, count(self::$baseflor_col), NULL)); |
return; |
} |
|
// cache |
self::$cache['getBaseflor'][$cache_id] = $data; |
$ligne = array_merge($ligne, $data); |
} |
|
static function champsEtendus_preload($cel, $obsids) { |