<?php
/***************************************************************************
- * Copyright (C) 2003-2008 Polytechnique.org *
+ * Copyright (C) 2003-2010 Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
parent::__construct($_user, false, 'medal', $_stamp);
$this->mid = $_idmedal;
$this->gid = $_subidmedal;
+ if (is_null($this->gid)) {
+ $this->gid = 0;
+ }
}
// }}}
register_watch_op($this->user->id(), WATCH_FICHE, '', 'medals');
return XDB::execute('REPLACE INTO profile_medals_sub
VALUES ({?}, {?}, {?})',
- $this->user->id(), $this->mid, $this->gid);
+ $this->user->id(), $this->mid,
+ is_null($this->gid) ? 0 : $this->gid);
}
// }}}