/** * Renvoie un tableau où l'index est $wantedIndex au lieu de 0,1,2,3,... * @param STRING $wantedIndex Le nom du champ à utiliser comme index * @return ARRAY Le nouveau tableau avec l'index remplacé, FALSE si erreur */ public function reindexList($wantedIndex = 'id') { if ($this->result == null || empty($this->result)) { return false; } if (!Infos::colIndex_isUnique($this->table, $wantedIndex)) { throw new Exception("Listing::reindexList() : '{$wantedIndex}' is not an unique index for table '{$this->table}'"); } $newTableau = $this->result; Listing::array_reindex_by($newTableau, $wantedIndex); return $newTableau; }