1: <?php if (!defined('APPLICATION')) exit();
2: /* Copyright 2013 Zachary Doll */
3:
4: /**
5: * This contains static functions to get models and objects related to Yaga
6: *
7: * @package Yaga
8: * @since 1.0
9: */
10: class Yaga {
11:
12: /**
13: * A single copy of ActionModel available to plugins and hooks files.
14: *
15: * @var ActionModel
16: */
17: protected static $_ActionModel = NULL;
18:
19: /**
20: * A single copy of ReactionModel available to plugins and hooks files.
21: *
22: * @var ReactionModel
23: */
24: protected static $_ReactionModel = NULL;
25:
26: /**
27: * A single copy of BadgeModel available to plugins and hooks files.
28: *
29: * @var BadgeModel
30: */
31: protected static $_BadgeModel = NULL;
32:
33: /**
34: * A single copy of RankModel available to plugins and hooks files.
35: *
36: * @var RankModel
37: */
38: protected static $_RankModel = NULL;
39:
40: /**
41: * A single copy of BadgeAwardModel available to plugins and hooks files.
42: *
43: * @var BadgeAwardModel
44: */
45: protected static $_BadgeAwardModel = NULL;
46:
47: /**
48: * Get a reference to the action model
49: * @return ActionModel
50: */
51: public static function ActionModel() {
52: if (is_null(self::$_ActionModel)) {
53: self::$_ActionModel = new ActionModel();
54: }
55: return self::$_ActionModel;
56: }
57:
58: /**
59: * Get a reference to the reaction model
60: * @return ReactionModel
61: */
62: public static function ReactionModel() {
63: if (is_null(self::$_ReactionModel)) {
64: self::$_ReactionModel = new ReactionModel();
65: }
66: return self::$_ReactionModel;
67: }
68:
69: /**
70: * Get a reference to the badge model
71: * @return BadgeModel
72: */
73: public static function BadgeModel() {
74: if (is_null(self::$_BadgeModel)) {
75: self::$_BadgeModel = new BadgeModel();
76: }
77: return self::$_BadgeModel;
78: }
79:
80: /**
81: * Get a reference to the badge award model
82: * @return BadgeAwardModel
83: */
84: public static function BadgeAwardModel() {
85: if (is_null(self::$_BadgeAwardModel)) {
86: self::$_BadgeAwardModel = new BadgeAwardModel();
87: }
88: return self::$_BadgeAwardModel;
89: }
90:
91: /**
92: * Get a reference to the rank model
93: * @return RankModel
94: */
95: public static function RankModel() {
96: if (is_null(self::$_RankModel)) {
97: self::$_RankModel = new RankModel();
98: }
99: return self::$_RankModel;
100: }
101: }
102: