芝麻web文件管理V1.00
编辑当前文件:/home/p/r/i/prismawe/www/resuamer/site/application/classes/model/evenement.php
array( 'model' => 'candidat', 'foreign_key' => 'candidat_id' ), 'typeevenement' => array( 'model' => 'typeevenement', 'foreign_key' => 'typeevenement_id' ), ); protected $_has_many = array( 'evenementslang' => array( 'model' => 'evenementlang', 'foreign_key' => 'evenement_id' ), ); /* public $date; public $candidat_id; public $themeevenement_id; public $date_fin; //*/ public function getId() { return $this->id; } public function setId($id) { $this->id = $id; } public function getDate($format = 'aaaa-mm-jj') { switch ($format) { case 'jj/mm/aaaa': $tmp = explode(' ', $this->date); $tmp = explode('-', $tmp[0]); if(count($tmp)==3){ return $tmp[2].'/'.$tmp[1].'/'.$tmp[0]; }else{ return false; } break; case 'aaaa-mm-jj': return $this->date; break; case 'jj/mm': $tmp = explode(' ', $this->date); $tmp = explode('-', $tmp[0]); if(count($tmp)==3){ return $tmp[2].'/'.$tmp[1]; }else{ return false; } break; case 'long': $MONTH = array('01'=> 'Janvier','02'=> 'Février','03'=> 'Mars','04'=> 'Avril','05'=> 'Mai', '06'=> 'Juin','07'=> 'Juillet','08'=> 'Août','09'=> 'Septembre','10'=> 'Octobre', '11'=> 'Novembre','12'=> 'Décembre'); $tmp = explode(' ', $this->date); if(count($tmp)==2){ $tmpDATE = explode('-', $tmp[0]); $tmpTIME = explode(':', $tmp[1]); if(count($tmpDATE)==3 && count($tmpTIME)==3){ return $tmpDATE[2].' '.$MONTH[$tmpDATE[1]].' '.$tmpDATE[0].' à '.$tmpTIME[0].'h'.$tmpTIME[1]; }else{ return false; } }else{ return false; } break; default: $tmp = explode('-', $this->date); if(count($tmp)==3){ return $tmp[2].'/'.$tmp[1].'/'.$tmp[0]; }else{ return false; } break; } } public function setDate($date) { $this->date = $date; } public function getCandidat_id() { return $this->candidat_id; } public function setCandidat_id($candidat_id) { $this->candidat_id = $candidat_id; } public function getLibelle() { $lang = ORM::factory('lang')->where('name', '=', I18n::$lang)->find(); if($lang->loaded()) return $this->evenementslang->where('lang_id', '=', $lang->id)->find()->getLibelle(); else{ return $this->evenementslang->where('lang_id', '=', 1)->find()->getLibelle(); } } public function getTypeevenement_id() { return $this->typeevenement_id; } public function setTypeevenement_id($typeevenement_id) { $this->typeevenement_id = $typeevenement_id; } public function getDate_fin() { return $this->date_fin; } public function setDate_fin($date_fin) { $this->date_fin = $date_fin; } }