. */ /** * Plenaries Service */ require_once(FILESYSTEMROOTPATH."jc/include/dao/PlenariesDao.php"); class PlenariesService { private $plenariesDao; /** * Default constructor * * @param PlenariesDao */ public function __construct(PlenariesDao $plenariesDao) { $this->plenariesDao = $plenariesDao; } /** * Load a plenary by id * * @param string id of the plenary to be loaded * @return a plenary object */ public function load($id) { return $this->plenariesDao->load($id); } /** * Load all plenaries of the current Agora * * @return array of plenaries */ public function loadAll() { return $this->plenariesDao->loadAll(); } /** * Load all plenary names of the current Agora * * @return array of plenaries */ public function loadAllnames(){ return $this->plenariesDao->loadAllNames(); } /** * Save or update Plenaries: * * @param Plenaries object * @return boolean [success or fail] */ public function SaveOrUpdate( $plenary ){ if( $plenary->getStatus() ){ $barcodeService = $GLOBALS['ClassFactory']->getBarcodeService(); if( ! $barcodeService->CloseOpenSessions( $plenary->getClose() ) ) return false; if( ! $this->plenariesDao->saveOrUpdate( $plenary ) ) return false; return true; }else return $this->plenariesDao->saveOrUpdate( $plenary ); } } ?>