1 <?php
2 /**
3 * XLRstats : Real Time Player Stats (http://www.xlrstats.com)
4 * (CC) BY-NC-SA 2005-2013, Mark Weirath, Özgür Uysal
5 *
6 * Licensed under the Creative Commons BY-NC-SA 3.0 License
7 * Redistributions of files must retain the above copyright notice.
8 *
9 * @link http://www.xlrstats.com
10 * @license Creative Commons BY-NC-SA 3.0 License (http://creativecommons.org/licenses/by-nc-sa/3.0/)
11 * @package app.Model
12 * @since XLRstats v3.0
13 * @version 0.1
14 */
15
16 class PlayerWeapon extends AppModel {
17
18 /**
19 * Can connect to b3Database?
20 *
21 * @var bool
22 */
23 public $b3Database = true;
24
25 /**
26 * Name
27 *
28 * @var string
29 */
30 public $name = 'PlayerWeapon';
31
32 /**
33 * Database table name
34 *
35 * @var string
36 */
37 public $useTable = 'xlr_weaponusage';
38
39 /**
40 * Database associations
41 *
42 * @var array
43 */
44 public $belongsTo = array(
45 'WeaponStat' => array(
46 'className' => 'WeaponStat',
47 'foreignKey' => 'weapon_id',
48 ),
49 'PlayerStat' => array(
50 'className' => 'PlayerStat',
51 'foreignKey' => 'player_id',
52 )
53 );
54
55 //-------------------------------------------------------------------
56
57 /**
58 * Overrides __construct method to be able to use custom tables names
59 */
60 public function __construct() {
61 parent::__construct();
62 $this->setSource(Configure::read('options.table_weaponusage'));
63 }
64 }