Example #1
0
 /**
  *
  * @param boolean $pReload = FALSE
  * @return Model_Zupalatoms
  */
 public function get_atom($pReload = FALSE)
 {
     $out = parent::get_atom($pReload);
     if (!$out->get_model_class() != ($class = get_class($this))) {
         $out->set_model_class($class);
     }
     return $out;
 }
Example #2
0
 /**
  *
  * @param boolean $pTotal = FALSE
  * @return void
  */
 public function delete($pTotal = FALSE)
 {
     if ($pTotal) {
         return parent::delete();
     } else {
         $this->active = 0;
         $this->save();
     }
 }
 /**
  * @return array
  */
 public function toArray($pExtend = TRUE)
 {
     $out = parent::toArray();
     if ($pExtend) {
         $out['game'] = $this->game_type()->title;
     }
     $out['players'] = $this->player_count();
     return $out;
 }
 /**
  * @param $pMode
  */
 public function move($pMode)
 {
     $params = array('game_type' => $this->game_type, 'active' => 1);
     $data = $this->find($params, 'rank');
     parent::move($this, $pMode, 'rank');
 }