Bonjour,

Voila j'ai un souci sur cette class:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
class Comptabilise{
 
public $idcomp;
 
function __construct(){
 
	}
 
 
	function set($id){
		$this->idcomp = $id;	
	}
 
       function getOrdre(){
 
		$db	= base::getInstance();
		if($this->idcomp){
			$sql = "WHERE idcomp = " .(int) $this->idcomp;	
		}
 
		$query = "SELECT * FROM sf_comptabilise "	
				.$sql;
 
		$db->setQuery($query);
		$result = $db->loadObjectList();
 
		return $result;
	}
 
}
Lorsque je charge la function getOrdre j'ai :
Fatal error: Using $this when not in object context

Voyez-vous pourquoi?

Merci.