<?php
/***************************************************************************
- * Copyright (C) 2003-2007 Polytechnique.org *
+ * Copyright (C) 2003-2008 Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
// }}}
// {{{ constructor
- public function __construct($_uid, $_idmedal, $_subidmedal, $_stamp=0)
+ public function __construct(User &$_user, $_idmedal, $_subidmedal, $_stamp=0)
{
- parent::__construct($_uid, false, 'medal', $_stamp);
- $this->mid = $_idmedal;
+ parent::__construct($_user, false, 'medal', $_stamp);
+ $this->mid = $_idmedal;
$this->gid = $_subidmedal;
}
public function commit ()
{
- return XDB::execute('REPLACE INTO profile_medals_sub VALUES({?}, {?}, {?})', $this->uid, $this->mid, $this->gid);
+ require_once 'notifs.inc.php';
+ 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);
}
// }}}