Subversion Repositories eFlore/Applications.del

Rev

Rev 723 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 723 Rev 1612
Line 55... Line 55...
55
		if (!isset($this->bdd)){
55
		if (!isset($this->bdd)){
56
			$this->bdd = new Bdd();
56
			$this->bdd = new Bdd();
57
		}
57
		}
58
		return $this->bdd;
58
		return $this->bdd;
59
	}
59
	}
60
	
-
 
61
	/** Formater un nom de table avec le schéma de la base de données, s'il existe
-
 
62
	 *  @param String $table le nom de la table
-
 
63
	 *  @param String $as (optionnel) l'alias de la table 
-
 
64
	 *  @return String la chaine de caractère sous la forme "schema.nomtable as nt"
-
 
65
	 * */
-
 
66
	public function formaterTable($table, $as = null) {
-
 
67
		$chaineTable = $table;
-
 
68
		if ($this->schemaBdd != null) {
-
 
69
			$chaineTable = $this->schemaBdd.'.'.$table;
-
 
70
		}
-
 
71
		if ($as != null && $as != '') {
-
 
72
			$chaineTable .= ' as '.$as;
-
 
73
		}
-
 
74
		return $chaineTable.' ';
-
 
75
	}
-
 
76
	
-
 
77
	/** Formater des noms de table avec le schéma de la base de données, s'il existe
-
 
78
	*  @param Array $tables un tableau à deux dimensions contenant le nom et l'alias de la table 
-
 
79
	*	Ex : Array("nom" => "as", "table" => "") 
-
 
80
	*  @return String la chaine de caractère sous la forme "schema.nomtable as nt, schema.nomtable2 as nt2"
-
 
81
	* */
-
 
82
	public function formaterTables($tables) {
-
 
83
		$tablesFormatees = array();
-
 
84
		foreach ($tables as $nom => $as) {
-
 
85
			$tablesFormatees[] = $this->formaterTable($nom, $as);
-
 
86
		}
-
 
87
		
-
 
88
		return implode(',', $tablesFormatees);
-
 
89
	}
-
 
90
}
60
}
91
?>
61
?>
92
62