1: <?php
2: /*
3: You may not change or alter any portion of this comment or credits
4: of supporting developers from this source code or any supporting source code
5: which is considered copyrighted (c) material of the original comment or credit authors.
6:
7: This program is distributed in the hope that it will be useful,
8: but WITHOUT ANY WARRANTY; without even the implied warranty of
9: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10: */
11:
12: namespace Xoops\Core\Service\Contract;
13:
14: use Xoops\Core\Service\Response;
15: use Xoops\Core\Service\Manager;
16:
17: /**
18: * UserRank service interface
19: *
20: * @category Xoops\Core\Service\Contract
21: * @package Xoops\Core
22: * @author Richard Griffith <richard@geekwright.com>
23: * @copyright 2015 The XOOPS Project https://github.com/XOOPS/XoopsCore
24: * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
25: * @version Release: 1.0
26: * @link http://xoops.org
27: * @since 2.6.0
28: */
29: interface UserRankInterface
30: {
31: const MODE = Manager::MODE_EXCLUSIVE;
32:
33: /**
34: * getUserRank - given user info return array of rank information for the user
35: *
36: * @param Response $response \Xoops\Core\Service\Response object
37: * @param mixed $userinfo Xoops\Core\Kernel\Handlers\XoopsUser object for user (preferred) or
38: * array of user info,
39: * 'uid' => (int) id of system user
40: * 'posts' => (int) contribution count associated with the user
41: * 'rank' => (int) id of manually assigned rank, 0 if none assigned
42: *
43: * @return void - $response->value set to array of rank information
44: * 'title' => string that describes the rank
45: * 'image' => url of image associated with the rank
46: */
47: public function getUserRank(Response $response, $userinfo);
48:
49: /**
50: * getAssignableUserRankList - return a list of ranks that can be assigned
51: *
52: * @param Response $response \Xoops\Core\Service\Response object
53: *
54: * @return void - response->value set to array of (int) id => (string) rank title
55: * entries of assignable ranks
56: */
57: public function getAssignableUserRankList(Response $response);
58: }
59: