Changeset 26434
- Timestamp:
- 01/09/10 16:44:17 (3 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/dmChessPlugin
- Property svn:ignore set to
.settings
.project
.buildpath
nbproject
- Property svn:ignore set to
plugins/dmChessPlugin/lib/model/doctrine/PluginDmChessGameTable.class.php
r25984 r26434 4 4 class PluginDmChessGameTable extends myDoctrineTable 5 5 { 6 7 public function broom() 8 { 9 $query = $this->createQuery('g') 10 // games created yesterday, without a move 11 ->where('g.created_at < ? AND g.turns = ?', array(date ("Y-m-d H:i:s", strtotime('-1 day')), 0)) 12 // games with last move one month ago, and not finished 13 ->orWhere('g.updated_at < ? AND g.is_finished = ?', array(date ("Y-m-d H:i:s", strtotime('-1 month')), false)); 14 15 $query->delete()->execute(); 16 } 6 17 7 18 public function preload($id) plugins/dmChessPlugin/modules/dmChessGame/actions/actions.class.php
r26010 r26434 171 171 public function executeCreate(dmWebRequest $request) 172 172 { 173 // clean old games 174 dmDb::table('DmChessGame')->broom(); 175 173 176 return $this->redirect($this->getHelper()->£link($this->getPage())->param('p', dmDb::table('DmChessPlayer')->startNewGame()->code)->getHref()); 174 177 }