예제 #1
0
 /**
  *
  * @param boolean $pReload
  * @return Synerg_Model_Gametypes
  */
 public static function getInstance($pReload = FALSE)
 {
     if ($pReload || is_null(self::$_Instance)) {
         // process
         self::$_Instance = new self();
     }
     return self::$_Instance;
 }
예제 #2
0
 /**
  * return a JSON Dojo data block
  */
 public function store()
 {
     $gt = Synerg_Model_Gametypes::getInstance()->synergy_gametype();
     $out = array();
     $classes = Synerg_Model_Gameresourceclasses::getInstance()->find(array('active' => 1, 'game_type' => $gt->identity()));
     foreach ($classes as $class) {
         $cn = $class->title;
         foreach ($class->resource_types() as $resource) {
             $data = $resource->toArray(TRUE);
             $data['resource_class_name'] = $cn;
             $out[] = $data;
         }
     }
     $this->get_controller()->_store('id', $out);
 }
예제 #3
0
 /**
  *
  */
 public function save()
 {
     $sgt = Synerg_Model_Gametypes::synergy_gametype();
     $sgt_id = $sgt->identity();
     return parent::save();
 }
예제 #4
0
 /**
  *
  * @param  $pUser = NULL
  * @return
  */
 public function active_session($pUser = NULL)
 {
     $sgt = Synerg_Model_Gametypes::getInstance()->synergy_gametype();
     $sgt_id = $sgt->identity();
     return parent::active_session($sgt_id, $pUser);
 }