Citation:
]Trying to get property 'cout_theorique' of non-object
#0 C:\xampp\htdocs\HyperInterim\model\model_mission.php(29): exception_error_handler(8, 'Trying to get p...', 'C:\\xampp\\htdocs...', 29, Array)
#1 C:\xampp\htdocs\HyperInterim\module\mission\main.php(124): model_maison->getMonCalcul(NULL)
#2 C:\xampp\htdocs\lib\framework\class_root.php(264): module_maison->_edit()
#3 C:\xampp\htdocs\HyperInterim\public\index.php(47): _root->run()
#4 {main}
Detail:
#0 C:\xampp\htdocs\hypermaison\model\model_maison.php (29)
exception_error_handler( , 'Trying to get property 'cout_theorique' of non-object' , 'C:\xampp\htdocs\HyperInterim\model\model_maison.php' , , Array ( [idMaison] => [oMaison] => ) )
#1 C:\xampp\htdocs\HyperInterim\module\maison\main.php (124)
model_mission -> getMonCalcul( NULL )
#2 C:\xampp\htdocs\lib\framework\class_root.php (264)
module_mission -> _edit( )
#3 C:\xampp\htdocs\HyperInterim\public\index.php (47)
_root -> run( )
#4 {main}
Fichier : C:\xampp\htdocs\HyperMaison\model\model_maison.php ligne 29
Message : Trying to get property 'cout_theorique' of non-object
11 public static function getInstance(){
12 return self::_getInstance(__CLASS__);
13 }
14
15 public function findById($uId){
16 return $this->findOne('SELECT DISTINCT * FROM '.$this->sTable.' WHERE idmaison=?',$uId );
17 }
18 public function findAll(){
19 return $this->findMany('SELECT DISTINCT * FROM '.$this->sTable);
20 }
21 public function findValidation($uId){
22 return $this->findMany('SELECT * FROM '.$this->sTable.' WHERE idmaison=?',$uId);
23 }
24 public function findOrderBY(){
25 return $this->findMany('SELECT * FROM '.$this->sTable.' ORDER BY etat ASC');
26 }
27 public function getMonCalcul($idAgence){
28 $oMission=$this->findOne('SELECT heurejourtotal * coutmoyheurint AS cout_theorique FROM maison,agence WHERE idAgence=?',$idAgence);
29 return $oMission->cout_theorique;
30 }
Que faire ? Que dois-je mettre dans mon model et que dois-je mettre dans le main de mon module et dans quel view cela dois etre retranscrit ?
Citation:
public function _edit(){
$tMessage=$this->processSaveEdit();
$oMaison=model_maison::getInstance()->findById( _root::getParam('id') );
$oMaison=model_maison::getInstance()->getMonCalcul(_root::getParam('idAgence'));
$oView=new _view('mission::edit');
$oView->oMaison=$oMaison;
$oView->tId=model_maison::getInstance()->getIdTab();
$oView->tJoinmodel_agence=model_agence::getInstance()->getSelect();
$oView->tJoinmodel_rayon=model_rayon::getInstance()->getSelect();
$oView->tJoinmodel_accroimotif=model_accroimotif::getInstance()->getSelect();
$oView->tJoinmodel_absence=model_absence::getInstance()->getSelect();
$oPluginXsrf=new plugin_xsrf();
$oView->token=$oPluginXsrf->getToken();
$oView->tMessage=$tMessage;
$this->oLayout->add('main',$oView);
}