. */ require_once(FILESYSTEMROOTPATH."jc/include/dao/RankedVoteDao.php"); class RankedVoteService { private $rankedVoteDao; /** * Default constructor * * @param RankVoteDao */ public function __construct(RankedVoteDao $rankedVoteDao) { $this->rankedVoteDao = $rankedVoteDao; } /** * Load a rankVote by id * * @param string id of the poll to be loaded * @return an poll object */ public function load($id) { return $this->rankedVoteDao->load($id); } /** * Load polls by agorae_id * * @return array of polls */ public function loadByAgora($agora_id) { return $this->rankedVoteDao->loadByAgora($agora_id); } public function loadOpen($agora_id){ return $this->rankedVoteDao->loadOpen($agora_id); } public function countVotes($id) { $this->rankedVoteDao->countVotes($id); } public function loadClosed($agora_id){ return $this->rankedVoteDao->loadClosed($agora_id); } /** * Save or update poll: * * @param poll object * @return boolean [success or fail] */ public function saveOrUpdate($poll){ return $this->rankedVoteDao->saveOrUpdate($poll); } public function get_last_id(){ return $this->rankedVoteDao->get_last_id(); } } ?>