Example #1
0
 /**
  * Overload BBModel's reset() so we can also 
  *  reset any cached opponent / match data
  * 
  * This is important, since when reportin wins, reload() is called, which calls
  *      reset() - so we need to make sure that we honor the reaload() and re-query for
  *      opponent / eliminated_by etc
  */
 public function reset()
 {
     parent::reset();
     $this->reset_opponents();
 }
Example #2
0
 /**
  * Overrides BBModel::reset() so we can define the $teams array for removing unsaved teams,
  *  and so we can unflag {@link $winner_set} if appropriate
  * 
  * {@inheritdoc}
  */
 public function reset()
 {
     //BBModel's default action first
     parent::reset();
     //For new matches, reset the winner if defined
     if (is_null($this->id)) {
         $this->winner_set = false;
     }
     //Now let BBModel remove any unsaved teams from $this->teams
     $this->remove_new_children($this->games());
     return true;
 }
 /**
  * Revert all changes<br />
  * Overrides {@link BBModel::reset()} so we can define the $teams array for removing unsaved teams
  * {@inheritdoc}
  */
 public function reset()
 {
     //BBModel's default action first
     parent::reset();
     //Now let BBModel remove any unsaved teams from $this->teams
     $this->remove_new_children($this->teams);
 }