芝麻web文件管理V1.00
编辑当前文件:/home/p/r/i/prismawe/www/resuamer/site/application/classes/model/proposition.php
array( 'model' => 'candidat', 'foreign_key' => 'candidat_id' ), 'election' => array( 'model' => 'election', 'foreign_key' => 'election_id' ), ); protected $_has_many = array( 'propositionslang' => array( 'model' => 'propositionlang', 'foreign_key' => 'proposition_id' ), 'votes' => array( 'model' => 'vote', 'foreign_key' => 'proposition_id' ), ); /* public $id; public $candidat_id; public $election_id; public $theme_id; public $libelle; //*/ public $question; public function getId() { return $this->id; } public function setId($id) { $this->id = $id; } public function getCandidat_id() { return $this->candidat_id; } public function setCandidat_id($candidat_id) { $this->candidat_id = $candidat_id; } public function getElection_id() { return $this->election_id; } public function setElection_id($election_id) { $this->election_id = $election_id; } public function getTheme_id() { return $this->theme_id; } public function setTheme_id($theme_id) { $this->theme_id = $theme_id; } public function getLibelle() { $lang = ORM::factory('lang')->where('name', '=', I18n::$lang)->find(); if($lang->loaded()) return $this->propositionslang->where('lang_id', '=', $lang->id)->find()->getLibelle(); else{ return $this->propositionslang->where('lang_id', '=', 1)->find()->getLibelle(); } } public function setLibelle($libelle) { $this->libelle = $libelle; } public function getQuestion() { $lang = ORM::factory('lang')->where('name', '=', I18n::$lang)->find(); if($lang->loaded()) return $this->propositionslang->where('lang_id', '=', $lang->id)->find()->getQuestion(); else{ return $this->propositionslang->where('lang_id', '=', 1)->find()->getQuestion(); } } public function setQuestion($question) { $this->question = $question; } }