@@ -12,25 +12,25 @@ |
||
12 | 12 | class EE_Extra_Join extends EE_Base_Class |
13 | 13 | { |
14 | 14 | |
15 | - /** |
|
16 | - * @param array $props_n_values |
|
17 | - * @param null $timezone |
|
18 | - * @return EE_Extra_Join|mixed |
|
19 | - */ |
|
20 | - public static function new_instance($props_n_values = array(), $timezone = null) |
|
21 | - { |
|
22 | - $has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone); |
|
23 | - return $has_object ? $has_object : new self($props_n_values, false, $timezone); |
|
24 | - } |
|
15 | + /** |
|
16 | + * @param array $props_n_values |
|
17 | + * @param null $timezone |
|
18 | + * @return EE_Extra_Join|mixed |
|
19 | + */ |
|
20 | + public static function new_instance($props_n_values = array(), $timezone = null) |
|
21 | + { |
|
22 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone); |
|
23 | + return $has_object ? $has_object : new self($props_n_values, false, $timezone); |
|
24 | + } |
|
25 | 25 | |
26 | 26 | |
27 | - /** |
|
28 | - * @param array $props_n_values |
|
29 | - * @param null $timezone |
|
30 | - * @return EE_Extra_Join |
|
31 | - */ |
|
32 | - public static function new_instance_from_db($props_n_values = array(), $timezone = null) |
|
33 | - { |
|
34 | - return new self($props_n_values, true, $timezone); |
|
35 | - } |
|
27 | + /** |
|
28 | + * @param array $props_n_values |
|
29 | + * @param null $timezone |
|
30 | + * @return EE_Extra_Join |
|
31 | + */ |
|
32 | + public static function new_instance_from_db($props_n_values = array(), $timezone = null) |
|
33 | + { |
|
34 | + return new self($props_n_values, true, $timezone); |
|
35 | + } |
|
36 | 36 | } |
@@ -10,163 +10,163 @@ |
||
10 | 10 | class EE_Price_Type extends EE_Soft_Delete_Base_Class |
11 | 11 | { |
12 | 12 | |
13 | - /** |
|
14 | - * @param array $props_n_values |
|
15 | - * @return EE_Price_Type |
|
16 | - */ |
|
17 | - public static function new_instance($props_n_values = array()) |
|
18 | - { |
|
19 | - $has_object = parent::_check_for_object($props_n_values, __CLASS__); |
|
20 | - return $has_object ? $has_object : new self($props_n_values); |
|
21 | - } |
|
22 | - |
|
23 | - |
|
24 | - /** |
|
25 | - * @param array $props_n_values |
|
26 | - * @return EE_Price_Type |
|
27 | - */ |
|
28 | - public static function new_instance_from_db($props_n_values = array()) |
|
29 | - { |
|
30 | - return new self($props_n_values, true); |
|
31 | - } |
|
32 | - |
|
33 | - |
|
34 | - /** |
|
35 | - * Set Price Type Name |
|
36 | - * |
|
37 | - * @access public |
|
38 | - * @param string $PRT_name |
|
39 | - */ |
|
40 | - public function set_name($PRT_name = '') |
|
41 | - { |
|
42 | - $this->set('PRT_name', $PRT_name); |
|
43 | - } |
|
44 | - |
|
45 | - |
|
46 | - /** |
|
47 | - * Set Price Type a percent |
|
48 | - * |
|
49 | - * @access public |
|
50 | - * @param bool $PRT_is_percent |
|
51 | - */ |
|
52 | - public function set_is_percent($PRT_is_percent = false) |
|
53 | - { |
|
54 | - $this->set('PRT_is_percent', $PRT_is_percent); |
|
55 | - } |
|
56 | - |
|
57 | - |
|
58 | - /** |
|
59 | - * Set Price Type order |
|
60 | - * |
|
61 | - * @access public |
|
62 | - * @param int $PRT_order |
|
63 | - */ |
|
64 | - public function set_order($PRT_order = 0) |
|
65 | - { |
|
66 | - $this->set('PRT_order', $PRT_order); |
|
67 | - } |
|
68 | - |
|
69 | - |
|
70 | - /** |
|
71 | - * |
|
72 | - */ |
|
73 | - public function move_to_trash() |
|
74 | - { |
|
75 | - $this->set('PRT_deleted', true); |
|
76 | - } |
|
77 | - |
|
78 | - |
|
79 | - /** |
|
80 | - * |
|
81 | - */ |
|
82 | - public function restore_from_trash() |
|
83 | - { |
|
84 | - $this->set('PRT_deleted', false); |
|
85 | - } |
|
86 | - |
|
87 | - |
|
88 | - /** |
|
89 | - * get Price Type Name |
|
90 | - * |
|
91 | - * @access public |
|
92 | - */ |
|
93 | - public function name() |
|
94 | - { |
|
95 | - return $this->get('PRT_name'); |
|
96 | - } |
|
97 | - |
|
98 | - |
|
99 | - /** |
|
100 | - * get is Price Type a discount? |
|
101 | - * |
|
102 | - * @access public |
|
103 | - */ |
|
104 | - public function base_type() |
|
105 | - { |
|
106 | - return $this->get('PBT_ID'); |
|
107 | - } |
|
108 | - |
|
109 | - |
|
110 | - /** |
|
111 | - * @return mixed |
|
112 | - */ |
|
113 | - public function base_type_name() |
|
114 | - { |
|
115 | - return $this->get_pretty('PBT_ID'); |
|
116 | - } |
|
117 | - |
|
118 | - |
|
119 | - /** |
|
120 | - * get is Price Type a percent? |
|
121 | - * |
|
122 | - * @access public |
|
123 | - */ |
|
124 | - public function is_percent() |
|
125 | - { |
|
126 | - return $this->get('PRT_is_percent'); |
|
127 | - } |
|
128 | - |
|
129 | - |
|
130 | - /** |
|
131 | - * @return bool |
|
132 | - */ |
|
133 | - public function is_discount() |
|
134 | - { |
|
135 | - return $this->get('PBT_ID') == 2 ? true : false; |
|
136 | - } |
|
137 | - |
|
138 | - |
|
139 | - /** |
|
140 | - * get the author of the price type. |
|
141 | - * |
|
142 | - * @since 4.5.0 |
|
143 | - * |
|
144 | - * @return int |
|
145 | - */ |
|
146 | - public function wp_user() |
|
147 | - { |
|
148 | - return $this->get('PRT_wp_user'); |
|
149 | - } |
|
150 | - |
|
151 | - |
|
152 | - /** |
|
153 | - * get Price Type order |
|
154 | - * |
|
155 | - * @access public |
|
156 | - */ |
|
157 | - public function order() |
|
158 | - { |
|
159 | - return $this->get('PRT_order'); |
|
160 | - } |
|
161 | - |
|
162 | - |
|
163 | - /** |
|
164 | - * get is Price Type deleted ? |
|
165 | - * |
|
166 | - * @access public |
|
167 | - */ |
|
168 | - public function deleted() |
|
169 | - { |
|
170 | - return $this->get('PRT_deleted'); |
|
171 | - } |
|
13 | + /** |
|
14 | + * @param array $props_n_values |
|
15 | + * @return EE_Price_Type |
|
16 | + */ |
|
17 | + public static function new_instance($props_n_values = array()) |
|
18 | + { |
|
19 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__); |
|
20 | + return $has_object ? $has_object : new self($props_n_values); |
|
21 | + } |
|
22 | + |
|
23 | + |
|
24 | + /** |
|
25 | + * @param array $props_n_values |
|
26 | + * @return EE_Price_Type |
|
27 | + */ |
|
28 | + public static function new_instance_from_db($props_n_values = array()) |
|
29 | + { |
|
30 | + return new self($props_n_values, true); |
|
31 | + } |
|
32 | + |
|
33 | + |
|
34 | + /** |
|
35 | + * Set Price Type Name |
|
36 | + * |
|
37 | + * @access public |
|
38 | + * @param string $PRT_name |
|
39 | + */ |
|
40 | + public function set_name($PRT_name = '') |
|
41 | + { |
|
42 | + $this->set('PRT_name', $PRT_name); |
|
43 | + } |
|
44 | + |
|
45 | + |
|
46 | + /** |
|
47 | + * Set Price Type a percent |
|
48 | + * |
|
49 | + * @access public |
|
50 | + * @param bool $PRT_is_percent |
|
51 | + */ |
|
52 | + public function set_is_percent($PRT_is_percent = false) |
|
53 | + { |
|
54 | + $this->set('PRT_is_percent', $PRT_is_percent); |
|
55 | + } |
|
56 | + |
|
57 | + |
|
58 | + /** |
|
59 | + * Set Price Type order |
|
60 | + * |
|
61 | + * @access public |
|
62 | + * @param int $PRT_order |
|
63 | + */ |
|
64 | + public function set_order($PRT_order = 0) |
|
65 | + { |
|
66 | + $this->set('PRT_order', $PRT_order); |
|
67 | + } |
|
68 | + |
|
69 | + |
|
70 | + /** |
|
71 | + * |
|
72 | + */ |
|
73 | + public function move_to_trash() |
|
74 | + { |
|
75 | + $this->set('PRT_deleted', true); |
|
76 | + } |
|
77 | + |
|
78 | + |
|
79 | + /** |
|
80 | + * |
|
81 | + */ |
|
82 | + public function restore_from_trash() |
|
83 | + { |
|
84 | + $this->set('PRT_deleted', false); |
|
85 | + } |
|
86 | + |
|
87 | + |
|
88 | + /** |
|
89 | + * get Price Type Name |
|
90 | + * |
|
91 | + * @access public |
|
92 | + */ |
|
93 | + public function name() |
|
94 | + { |
|
95 | + return $this->get('PRT_name'); |
|
96 | + } |
|
97 | + |
|
98 | + |
|
99 | + /** |
|
100 | + * get is Price Type a discount? |
|
101 | + * |
|
102 | + * @access public |
|
103 | + */ |
|
104 | + public function base_type() |
|
105 | + { |
|
106 | + return $this->get('PBT_ID'); |
|
107 | + } |
|
108 | + |
|
109 | + |
|
110 | + /** |
|
111 | + * @return mixed |
|
112 | + */ |
|
113 | + public function base_type_name() |
|
114 | + { |
|
115 | + return $this->get_pretty('PBT_ID'); |
|
116 | + } |
|
117 | + |
|
118 | + |
|
119 | + /** |
|
120 | + * get is Price Type a percent? |
|
121 | + * |
|
122 | + * @access public |
|
123 | + */ |
|
124 | + public function is_percent() |
|
125 | + { |
|
126 | + return $this->get('PRT_is_percent'); |
|
127 | + } |
|
128 | + |
|
129 | + |
|
130 | + /** |
|
131 | + * @return bool |
|
132 | + */ |
|
133 | + public function is_discount() |
|
134 | + { |
|
135 | + return $this->get('PBT_ID') == 2 ? true : false; |
|
136 | + } |
|
137 | + |
|
138 | + |
|
139 | + /** |
|
140 | + * get the author of the price type. |
|
141 | + * |
|
142 | + * @since 4.5.0 |
|
143 | + * |
|
144 | + * @return int |
|
145 | + */ |
|
146 | + public function wp_user() |
|
147 | + { |
|
148 | + return $this->get('PRT_wp_user'); |
|
149 | + } |
|
150 | + |
|
151 | + |
|
152 | + /** |
|
153 | + * get Price Type order |
|
154 | + * |
|
155 | + * @access public |
|
156 | + */ |
|
157 | + public function order() |
|
158 | + { |
|
159 | + return $this->get('PRT_order'); |
|
160 | + } |
|
161 | + |
|
162 | + |
|
163 | + /** |
|
164 | + * get is Price Type deleted ? |
|
165 | + * |
|
166 | + * @access public |
|
167 | + */ |
|
168 | + public function deleted() |
|
169 | + { |
|
170 | + return $this->get('PRT_deleted'); |
|
171 | + } |
|
172 | 172 | } |
@@ -14,40 +14,40 @@ |
||
14 | 14 | class EE_Currency_Payment_Method extends EE_Base_Class |
15 | 15 | { |
16 | 16 | |
17 | - /** Currency to Payment Method Link ID @var CPM_ID */ |
|
18 | - protected $_CPM_ID = null; |
|
19 | - /** Currency Code @var CUR_code */ |
|
20 | - protected $_CUR_code = null; |
|
21 | - /** Payment Method ID @var PMD_ID */ |
|
22 | - protected $_PMD_ID = null; |
|
23 | - protected $_Payment_Method; |
|
24 | - protected $_Currency; |
|
17 | + /** Currency to Payment Method Link ID @var CPM_ID */ |
|
18 | + protected $_CPM_ID = null; |
|
19 | + /** Currency Code @var CUR_code */ |
|
20 | + protected $_CUR_code = null; |
|
21 | + /** Payment Method ID @var PMD_ID */ |
|
22 | + protected $_PMD_ID = null; |
|
23 | + protected $_Payment_Method; |
|
24 | + protected $_Currency; |
|
25 | 25 | |
26 | 26 | |
27 | - /** |
|
28 | - * |
|
29 | - * @param array $props_n_values incoming values |
|
30 | - * @param string $timezone incoming timezone (if not set the timezone set for the website will be |
|
31 | - * used.) |
|
32 | - * @param array $date_formats incoming date_formats in an array where the first value is the |
|
33 | - * date_format and the second value is the time format |
|
34 | - * @return EE_Attendee |
|
35 | - */ |
|
36 | - public static function new_instance($props_n_values = array(), $timezone = null, $date_formats = array()) |
|
37 | - { |
|
38 | - $has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone, $date_formats); |
|
39 | - return $has_object ? $has_object : new self($props_n_values, false, $timezone, $date_formats); |
|
40 | - } |
|
27 | + /** |
|
28 | + * |
|
29 | + * @param array $props_n_values incoming values |
|
30 | + * @param string $timezone incoming timezone (if not set the timezone set for the website will be |
|
31 | + * used.) |
|
32 | + * @param array $date_formats incoming date_formats in an array where the first value is the |
|
33 | + * date_format and the second value is the time format |
|
34 | + * @return EE_Attendee |
|
35 | + */ |
|
36 | + public static function new_instance($props_n_values = array(), $timezone = null, $date_formats = array()) |
|
37 | + { |
|
38 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone, $date_formats); |
|
39 | + return $has_object ? $has_object : new self($props_n_values, false, $timezone, $date_formats); |
|
40 | + } |
|
41 | 41 | |
42 | 42 | |
43 | - /** |
|
44 | - * @param array $props_n_values incoming values from the database |
|
45 | - * @param string $timezone incoming timezone as set by the model. If not set the timezone for |
|
46 | - * the website will be used. |
|
47 | - * @return EE_Attendee |
|
48 | - */ |
|
49 | - public static function new_instance_from_db($props_n_values = array(), $timezone = null) |
|
50 | - { |
|
51 | - return new self($props_n_values, true, $timezone); |
|
52 | - } |
|
43 | + /** |
|
44 | + * @param array $props_n_values incoming values from the database |
|
45 | + * @param string $timezone incoming timezone as set by the model. If not set the timezone for |
|
46 | + * the website will be used. |
|
47 | + * @return EE_Attendee |
|
48 | + */ |
|
49 | + public static function new_instance_from_db($props_n_values = array(), $timezone = null) |
|
50 | + { |
|
51 | + return new self($props_n_values, true, $timezone); |
|
52 | + } |
|
53 | 53 | } |
@@ -12,280 +12,280 @@ |
||
12 | 12 | class EE_Question_Group extends EE_Soft_Delete_Base_Class |
13 | 13 | { |
14 | 14 | |
15 | - /** |
|
16 | - * @param array $props_n_values |
|
17 | - * @return EE_Question_Group|mixed |
|
18 | - */ |
|
19 | - public static function new_instance($props_n_values = array()) |
|
20 | - { |
|
21 | - $has_object = parent::_check_for_object($props_n_values, __CLASS__); |
|
22 | - return $has_object ? $has_object : new self($props_n_values); |
|
23 | - } |
|
24 | - |
|
25 | - |
|
26 | - /** |
|
27 | - * @param array $props_n_values |
|
28 | - * @return EE_Question_Group |
|
29 | - */ |
|
30 | - public static function new_instance_from_db($props_n_values = array()) |
|
31 | - { |
|
32 | - return new self($props_n_values, true); |
|
33 | - } |
|
34 | - |
|
35 | - |
|
36 | - /** |
|
37 | - * gets the question group's name |
|
38 | - * |
|
39 | - * @access public |
|
40 | - * @param bool $pretty |
|
41 | - * @return string |
|
42 | - */ |
|
43 | - public function name($pretty = false) |
|
44 | - { |
|
45 | - return $pretty ? $this->get_pretty('QSG_name') : $this->get('QSG_name'); |
|
46 | - } |
|
47 | - |
|
48 | - |
|
49 | - /** |
|
50 | - * Gets the question group's internal name |
|
51 | - * |
|
52 | - * @access public |
|
53 | - * @return string |
|
54 | - */ |
|
55 | - public function identifier() |
|
56 | - { |
|
57 | - return $this->get('QSG_identifier'); |
|
58 | - } |
|
59 | - |
|
60 | - |
|
61 | - /** |
|
62 | - * Gets the question group's description |
|
63 | - * |
|
64 | - * @access public |
|
65 | - * @param bool $pretty |
|
66 | - * @return string |
|
67 | - */ |
|
68 | - public function desc($pretty = false) |
|
69 | - { |
|
70 | - return $pretty ? $this->get_pretty('QSG_desc') : $this->get('QSG_desc'); |
|
71 | - } |
|
72 | - |
|
73 | - |
|
74 | - /** |
|
75 | - * Gets the question group's order number in a sequence |
|
76 | - * of other question groups |
|
77 | - * |
|
78 | - * @access public |
|
79 | - * @return int |
|
80 | - */ |
|
81 | - public function order() |
|
82 | - { |
|
83 | - return $this->get('QSG_order'); |
|
84 | - } |
|
85 | - |
|
86 | - |
|
87 | - /** |
|
88 | - * Returns whether to show the group's name on the frontend |
|
89 | - * |
|
90 | - * @access public |
|
91 | - * @return boolean |
|
92 | - */ |
|
93 | - public function show_group_name() |
|
94 | - { |
|
95 | - return $this->get('QSG_show_group_name'); |
|
96 | - } |
|
97 | - |
|
98 | - |
|
99 | - /** |
|
100 | - * Returns whether to show the group's description |
|
101 | - * on the frontend |
|
102 | - * |
|
103 | - * @access public |
|
104 | - * @return boolean |
|
105 | - */ |
|
106 | - public function show_group_desc() |
|
107 | - { |
|
108 | - return $this->get('QSG_show_group_desc'); |
|
109 | - } |
|
110 | - |
|
111 | - |
|
112 | - /** |
|
113 | - * Returns whether this is a 'system group' (meaning |
|
114 | - * a question group integral to the system, whose questions |
|
115 | - * relate to the attendee table) |
|
116 | - * |
|
117 | - * @access public |
|
118 | - * @return int |
|
119 | - */ |
|
120 | - public function system_group() |
|
121 | - { |
|
122 | - return $this->get('QSG_system'); |
|
123 | - } |
|
124 | - |
|
125 | - |
|
126 | - /** |
|
127 | - * get the author of the question group. |
|
128 | - * |
|
129 | - * @since 4.5.0 |
|
130 | - * |
|
131 | - * @return int |
|
132 | - */ |
|
133 | - public function wp_user() |
|
134 | - { |
|
135 | - return $this->get('QSG_wp_user'); |
|
136 | - } |
|
137 | - |
|
138 | - |
|
139 | - /** |
|
140 | - * Returns whether this question group has |
|
141 | - * been deleted |
|
142 | - * |
|
143 | - * @access public |
|
144 | - * @return boolean |
|
145 | - */ |
|
146 | - public function deleted() |
|
147 | - { |
|
148 | - return $this->get('QST_deleted'); |
|
149 | - } |
|
150 | - |
|
151 | - |
|
152 | - /** |
|
153 | - * Gets an array of questions with questions IN the group at the start of the array and questions NOT in the group |
|
154 | - * at the end of the array. Questions in the group are ordered by Question_Group_Question.QGQ_order and questions |
|
155 | - * NOT in the group are ordered by Question.QGQ_order |
|
156 | - * |
|
157 | - * @return EE_Question[] |
|
158 | - */ |
|
159 | - public function questions_in_and_not_in_group() |
|
160 | - { |
|
161 | - $questions_in_group = $this->questions(); |
|
162 | - $exclude_question_ids = ! empty($questions_in_group) ? array_keys($questions_in_group) : array(); |
|
163 | - $questions_not_in_group = $this->questions_not_in_group($exclude_question_ids); |
|
164 | - return $questions_in_group + $questions_not_in_group; |
|
165 | - } |
|
166 | - |
|
167 | - |
|
168 | - /** |
|
169 | - * Gets all the questions which are part of this question group (ordered Question_Group_Question.QGQ_order) |
|
170 | - * |
|
171 | - * @param array $query_params |
|
172 | - * @return EE_Question[] |
|
173 | - */ |
|
174 | - public function questions($query_params = array()) |
|
175 | - { |
|
176 | - $query_params = ! empty($query_params) ? $query_params |
|
177 | - : array('order_by' => array('Question_Group_Question.QGQ_order' => 'ASC')); |
|
178 | - return $this->ID() ? $this->get_many_related('Question', $query_params) : array(); |
|
179 | - } |
|
180 | - |
|
181 | - |
|
182 | - /** |
|
183 | - * Gets all the questions which are NOT part of this question group. |
|
184 | - * |
|
185 | - * @param mixed $question_IDS_in_group if empty array then all questions returned. if FALSE then we first get |
|
186 | - * questions in this group and exclude them from questions get all. IF empty |
|
187 | - * array then we just return all questions. |
|
188 | - * @return EE_Question[] |
|
189 | - */ |
|
190 | - public function questions_not_in_group($question_IDS_in_group = false) |
|
191 | - { |
|
192 | - if ($question_IDS_in_group === false) { |
|
193 | - $questions = $this->questions(); |
|
194 | - $question_IDS_in_group = ! empty($questions) ? array_keys($questions) : array(); |
|
195 | - } |
|
196 | - $_where = ! empty($question_IDS_in_group) ? array('QST_ID' => array('not_in', $question_IDS_in_group)) |
|
197 | - : array(); |
|
198 | - |
|
199 | - return EEM_Question::instance()->get_all(array($_where, 'order_by' => array('QST_ID' => 'ASC'))); |
|
200 | - } |
|
201 | - |
|
202 | - |
|
203 | - /** |
|
204 | - * Gets all events which are related to this question group |
|
205 | - * |
|
206 | - * @return EE_Event[] |
|
207 | - */ |
|
208 | - public function events() |
|
209 | - { |
|
210 | - return $this->get_many_related('Event'); |
|
211 | - } |
|
212 | - |
|
213 | - |
|
214 | - /** |
|
215 | - * Adds the question to this question group |
|
216 | - * |
|
217 | - * @param EE_Question || int $question object or ID |
|
218 | - * @return boolean if successful |
|
219 | - */ |
|
220 | - public function add_question($questionObjectOrID) |
|
221 | - { |
|
222 | - return $this->_add_relation_to($questionObjectOrID, 'Question'); |
|
223 | - } |
|
224 | - |
|
225 | - |
|
226 | - /** |
|
227 | - * Removes the question from this question group |
|
228 | - * |
|
229 | - * @param EE_Question || int $question object or ID |
|
230 | - * @return boolean of success |
|
231 | - */ |
|
232 | - public function remove_question($questionObjectOrID) |
|
233 | - { |
|
234 | - return $this->_remove_relation_to($questionObjectOrID, 'Question'); |
|
235 | - } |
|
236 | - |
|
237 | - |
|
238 | - /** |
|
239 | - * @param $questionObjectOrID |
|
240 | - * @param $qst_order |
|
241 | - * @return int |
|
242 | - */ |
|
243 | - public function update_question_order($questionObjectOrID, $qst_order) |
|
244 | - { |
|
245 | - $qst_ID = $questionObjectOrID instanceof EE_Question ? $questionObjectOrID->ID() : (int) $questionObjectOrID; |
|
246 | - return EEM_Question_Group_Question::instance()->update( |
|
247 | - array('QGQ_order' => $qst_order), |
|
248 | - array( |
|
249 | - array( |
|
250 | - 'QST_ID' => $qst_ID, |
|
251 | - 'QSG_ID' => $this->ID(), |
|
252 | - ), |
|
253 | - ) |
|
254 | - ); |
|
255 | - } |
|
256 | - |
|
257 | - |
|
258 | - /** |
|
259 | - * Basically this is method just returns whether the question group has any questions with answers. This is used |
|
260 | - * by the admin currently to determine whether we should display the ui for deleting permanently or not b/c |
|
261 | - * question groups with questions that have answers should not be possible to delete permanently |
|
262 | - * |
|
263 | - * @return boolean true if has questions with answers, false if not. |
|
264 | - */ |
|
265 | - public function has_questions_with_answers() |
|
266 | - { |
|
267 | - $has_answers = false; |
|
268 | - $questions = $this->get_many_related('Question'); |
|
269 | - foreach ($questions as $question) { |
|
270 | - if ($question->count_related('Answer') > 0) { |
|
271 | - $has_answers = true; |
|
272 | - } |
|
273 | - } |
|
274 | - return $has_answers; |
|
275 | - } |
|
276 | - |
|
277 | - |
|
278 | - /** |
|
279 | - * The purpose of this method is set the question group order for this question group to be the max out of all |
|
280 | - * question groups |
|
281 | - * |
|
282 | - * @access public |
|
283 | - * @return void |
|
284 | - */ |
|
285 | - public function set_order_to_latest() |
|
286 | - { |
|
287 | - $latest_order = $this->get_model()->get_latest_question_group_order(); |
|
288 | - $latest_order++; |
|
289 | - $this->set('QSG_order', $latest_order); |
|
290 | - } |
|
15 | + /** |
|
16 | + * @param array $props_n_values |
|
17 | + * @return EE_Question_Group|mixed |
|
18 | + */ |
|
19 | + public static function new_instance($props_n_values = array()) |
|
20 | + { |
|
21 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__); |
|
22 | + return $has_object ? $has_object : new self($props_n_values); |
|
23 | + } |
|
24 | + |
|
25 | + |
|
26 | + /** |
|
27 | + * @param array $props_n_values |
|
28 | + * @return EE_Question_Group |
|
29 | + */ |
|
30 | + public static function new_instance_from_db($props_n_values = array()) |
|
31 | + { |
|
32 | + return new self($props_n_values, true); |
|
33 | + } |
|
34 | + |
|
35 | + |
|
36 | + /** |
|
37 | + * gets the question group's name |
|
38 | + * |
|
39 | + * @access public |
|
40 | + * @param bool $pretty |
|
41 | + * @return string |
|
42 | + */ |
|
43 | + public function name($pretty = false) |
|
44 | + { |
|
45 | + return $pretty ? $this->get_pretty('QSG_name') : $this->get('QSG_name'); |
|
46 | + } |
|
47 | + |
|
48 | + |
|
49 | + /** |
|
50 | + * Gets the question group's internal name |
|
51 | + * |
|
52 | + * @access public |
|
53 | + * @return string |
|
54 | + */ |
|
55 | + public function identifier() |
|
56 | + { |
|
57 | + return $this->get('QSG_identifier'); |
|
58 | + } |
|
59 | + |
|
60 | + |
|
61 | + /** |
|
62 | + * Gets the question group's description |
|
63 | + * |
|
64 | + * @access public |
|
65 | + * @param bool $pretty |
|
66 | + * @return string |
|
67 | + */ |
|
68 | + public function desc($pretty = false) |
|
69 | + { |
|
70 | + return $pretty ? $this->get_pretty('QSG_desc') : $this->get('QSG_desc'); |
|
71 | + } |
|
72 | + |
|
73 | + |
|
74 | + /** |
|
75 | + * Gets the question group's order number in a sequence |
|
76 | + * of other question groups |
|
77 | + * |
|
78 | + * @access public |
|
79 | + * @return int |
|
80 | + */ |
|
81 | + public function order() |
|
82 | + { |
|
83 | + return $this->get('QSG_order'); |
|
84 | + } |
|
85 | + |
|
86 | + |
|
87 | + /** |
|
88 | + * Returns whether to show the group's name on the frontend |
|
89 | + * |
|
90 | + * @access public |
|
91 | + * @return boolean |
|
92 | + */ |
|
93 | + public function show_group_name() |
|
94 | + { |
|
95 | + return $this->get('QSG_show_group_name'); |
|
96 | + } |
|
97 | + |
|
98 | + |
|
99 | + /** |
|
100 | + * Returns whether to show the group's description |
|
101 | + * on the frontend |
|
102 | + * |
|
103 | + * @access public |
|
104 | + * @return boolean |
|
105 | + */ |
|
106 | + public function show_group_desc() |
|
107 | + { |
|
108 | + return $this->get('QSG_show_group_desc'); |
|
109 | + } |
|
110 | + |
|
111 | + |
|
112 | + /** |
|
113 | + * Returns whether this is a 'system group' (meaning |
|
114 | + * a question group integral to the system, whose questions |
|
115 | + * relate to the attendee table) |
|
116 | + * |
|
117 | + * @access public |
|
118 | + * @return int |
|
119 | + */ |
|
120 | + public function system_group() |
|
121 | + { |
|
122 | + return $this->get('QSG_system'); |
|
123 | + } |
|
124 | + |
|
125 | + |
|
126 | + /** |
|
127 | + * get the author of the question group. |
|
128 | + * |
|
129 | + * @since 4.5.0 |
|
130 | + * |
|
131 | + * @return int |
|
132 | + */ |
|
133 | + public function wp_user() |
|
134 | + { |
|
135 | + return $this->get('QSG_wp_user'); |
|
136 | + } |
|
137 | + |
|
138 | + |
|
139 | + /** |
|
140 | + * Returns whether this question group has |
|
141 | + * been deleted |
|
142 | + * |
|
143 | + * @access public |
|
144 | + * @return boolean |
|
145 | + */ |
|
146 | + public function deleted() |
|
147 | + { |
|
148 | + return $this->get('QST_deleted'); |
|
149 | + } |
|
150 | + |
|
151 | + |
|
152 | + /** |
|
153 | + * Gets an array of questions with questions IN the group at the start of the array and questions NOT in the group |
|
154 | + * at the end of the array. Questions in the group are ordered by Question_Group_Question.QGQ_order and questions |
|
155 | + * NOT in the group are ordered by Question.QGQ_order |
|
156 | + * |
|
157 | + * @return EE_Question[] |
|
158 | + */ |
|
159 | + public function questions_in_and_not_in_group() |
|
160 | + { |
|
161 | + $questions_in_group = $this->questions(); |
|
162 | + $exclude_question_ids = ! empty($questions_in_group) ? array_keys($questions_in_group) : array(); |
|
163 | + $questions_not_in_group = $this->questions_not_in_group($exclude_question_ids); |
|
164 | + return $questions_in_group + $questions_not_in_group; |
|
165 | + } |
|
166 | + |
|
167 | + |
|
168 | + /** |
|
169 | + * Gets all the questions which are part of this question group (ordered Question_Group_Question.QGQ_order) |
|
170 | + * |
|
171 | + * @param array $query_params |
|
172 | + * @return EE_Question[] |
|
173 | + */ |
|
174 | + public function questions($query_params = array()) |
|
175 | + { |
|
176 | + $query_params = ! empty($query_params) ? $query_params |
|
177 | + : array('order_by' => array('Question_Group_Question.QGQ_order' => 'ASC')); |
|
178 | + return $this->ID() ? $this->get_many_related('Question', $query_params) : array(); |
|
179 | + } |
|
180 | + |
|
181 | + |
|
182 | + /** |
|
183 | + * Gets all the questions which are NOT part of this question group. |
|
184 | + * |
|
185 | + * @param mixed $question_IDS_in_group if empty array then all questions returned. if FALSE then we first get |
|
186 | + * questions in this group and exclude them from questions get all. IF empty |
|
187 | + * array then we just return all questions. |
|
188 | + * @return EE_Question[] |
|
189 | + */ |
|
190 | + public function questions_not_in_group($question_IDS_in_group = false) |
|
191 | + { |
|
192 | + if ($question_IDS_in_group === false) { |
|
193 | + $questions = $this->questions(); |
|
194 | + $question_IDS_in_group = ! empty($questions) ? array_keys($questions) : array(); |
|
195 | + } |
|
196 | + $_where = ! empty($question_IDS_in_group) ? array('QST_ID' => array('not_in', $question_IDS_in_group)) |
|
197 | + : array(); |
|
198 | + |
|
199 | + return EEM_Question::instance()->get_all(array($_where, 'order_by' => array('QST_ID' => 'ASC'))); |
|
200 | + } |
|
201 | + |
|
202 | + |
|
203 | + /** |
|
204 | + * Gets all events which are related to this question group |
|
205 | + * |
|
206 | + * @return EE_Event[] |
|
207 | + */ |
|
208 | + public function events() |
|
209 | + { |
|
210 | + return $this->get_many_related('Event'); |
|
211 | + } |
|
212 | + |
|
213 | + |
|
214 | + /** |
|
215 | + * Adds the question to this question group |
|
216 | + * |
|
217 | + * @param EE_Question || int $question object or ID |
|
218 | + * @return boolean if successful |
|
219 | + */ |
|
220 | + public function add_question($questionObjectOrID) |
|
221 | + { |
|
222 | + return $this->_add_relation_to($questionObjectOrID, 'Question'); |
|
223 | + } |
|
224 | + |
|
225 | + |
|
226 | + /** |
|
227 | + * Removes the question from this question group |
|
228 | + * |
|
229 | + * @param EE_Question || int $question object or ID |
|
230 | + * @return boolean of success |
|
231 | + */ |
|
232 | + public function remove_question($questionObjectOrID) |
|
233 | + { |
|
234 | + return $this->_remove_relation_to($questionObjectOrID, 'Question'); |
|
235 | + } |
|
236 | + |
|
237 | + |
|
238 | + /** |
|
239 | + * @param $questionObjectOrID |
|
240 | + * @param $qst_order |
|
241 | + * @return int |
|
242 | + */ |
|
243 | + public function update_question_order($questionObjectOrID, $qst_order) |
|
244 | + { |
|
245 | + $qst_ID = $questionObjectOrID instanceof EE_Question ? $questionObjectOrID->ID() : (int) $questionObjectOrID; |
|
246 | + return EEM_Question_Group_Question::instance()->update( |
|
247 | + array('QGQ_order' => $qst_order), |
|
248 | + array( |
|
249 | + array( |
|
250 | + 'QST_ID' => $qst_ID, |
|
251 | + 'QSG_ID' => $this->ID(), |
|
252 | + ), |
|
253 | + ) |
|
254 | + ); |
|
255 | + } |
|
256 | + |
|
257 | + |
|
258 | + /** |
|
259 | + * Basically this is method just returns whether the question group has any questions with answers. This is used |
|
260 | + * by the admin currently to determine whether we should display the ui for deleting permanently or not b/c |
|
261 | + * question groups with questions that have answers should not be possible to delete permanently |
|
262 | + * |
|
263 | + * @return boolean true if has questions with answers, false if not. |
|
264 | + */ |
|
265 | + public function has_questions_with_answers() |
|
266 | + { |
|
267 | + $has_answers = false; |
|
268 | + $questions = $this->get_many_related('Question'); |
|
269 | + foreach ($questions as $question) { |
|
270 | + if ($question->count_related('Answer') > 0) { |
|
271 | + $has_answers = true; |
|
272 | + } |
|
273 | + } |
|
274 | + return $has_answers; |
|
275 | + } |
|
276 | + |
|
277 | + |
|
278 | + /** |
|
279 | + * The purpose of this method is set the question group order for this question group to be the max out of all |
|
280 | + * question groups |
|
281 | + * |
|
282 | + * @access public |
|
283 | + * @return void |
|
284 | + */ |
|
285 | + public function set_order_to_latest() |
|
286 | + { |
|
287 | + $latest_order = $this->get_model()->get_latest_question_group_order(); |
|
288 | + $latest_order++; |
|
289 | + $this->set('QSG_order', $latest_order); |
|
290 | + } |
|
291 | 291 | } |
@@ -11,86 +11,86 @@ |
||
11 | 11 | { |
12 | 12 | |
13 | 13 | |
14 | - /** |
|
15 | - * Used to reference when a registration has been checked out. |
|
16 | - * |
|
17 | - * @type int |
|
18 | - */ |
|
19 | - const status_checked_out = 0; |
|
20 | - |
|
21 | - /** |
|
22 | - * Used to reference when a registration has been checked in. |
|
23 | - * |
|
24 | - * @type int |
|
25 | - */ |
|
26 | - const status_checked_in = 1; |
|
27 | - |
|
28 | - /** |
|
29 | - * Used to reference when a registration has never been checked in. |
|
30 | - * |
|
31 | - * @type int |
|
32 | - */ |
|
33 | - const status_checked_never = 2; |
|
34 | - |
|
35 | - |
|
36 | - /** |
|
37 | - * |
|
38 | - * @param array $props_n_values incoming values |
|
39 | - * @param string $timezone incoming timezone (if not set the timezone set for the website will be used.) |
|
40 | - * @param array $date_formats incoming date_formats in an array |
|
41 | - * where the first value is the date_format |
|
42 | - * and the second value is the time format |
|
43 | - * @return EE_Checkin |
|
44 | - * @throws EE_Error |
|
45 | - */ |
|
46 | - public static function new_instance($props_n_values = array(), $timezone = null, $date_formats = array()) |
|
47 | - { |
|
48 | - $has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone, $date_formats); |
|
49 | - return $has_object |
|
50 | - ? $has_object |
|
51 | - : new self($props_n_values, false, $timezone, $date_formats); |
|
52 | - } |
|
53 | - |
|
54 | - |
|
55 | - /** |
|
56 | - * @param array $props_n_values incoming values from the database |
|
57 | - * @param string $timezone incoming timezone as set by the model. If not set the timezone for |
|
58 | - * the website will be used. |
|
59 | - * @return EE_Checkin |
|
60 | - * @throws EE_Error |
|
61 | - */ |
|
62 | - public static function new_instance_from_db($props_n_values = array(), $timezone = null) |
|
63 | - { |
|
64 | - return new self($props_n_values, true, $timezone); |
|
65 | - } |
|
66 | - |
|
67 | - |
|
68 | - public function ID() |
|
69 | - { |
|
70 | - return $this->get('CHK_ID'); |
|
71 | - } |
|
72 | - |
|
73 | - |
|
74 | - public function registration_id() |
|
75 | - { |
|
76 | - return $this->get('REG_ID'); |
|
77 | - } |
|
78 | - |
|
79 | - |
|
80 | - public function datetime_id() |
|
81 | - { |
|
82 | - return $this->get('DTT_ID'); |
|
83 | - } |
|
84 | - |
|
85 | - |
|
86 | - public function status() |
|
87 | - { |
|
88 | - return $this->get('CHK_in'); |
|
89 | - } |
|
90 | - |
|
91 | - |
|
92 | - public function timestamp() |
|
93 | - { |
|
94 | - return $this->get('CHK_timestamp'); |
|
95 | - } |
|
14 | + /** |
|
15 | + * Used to reference when a registration has been checked out. |
|
16 | + * |
|
17 | + * @type int |
|
18 | + */ |
|
19 | + const status_checked_out = 0; |
|
20 | + |
|
21 | + /** |
|
22 | + * Used to reference when a registration has been checked in. |
|
23 | + * |
|
24 | + * @type int |
|
25 | + */ |
|
26 | + const status_checked_in = 1; |
|
27 | + |
|
28 | + /** |
|
29 | + * Used to reference when a registration has never been checked in. |
|
30 | + * |
|
31 | + * @type int |
|
32 | + */ |
|
33 | + const status_checked_never = 2; |
|
34 | + |
|
35 | + |
|
36 | + /** |
|
37 | + * |
|
38 | + * @param array $props_n_values incoming values |
|
39 | + * @param string $timezone incoming timezone (if not set the timezone set for the website will be used.) |
|
40 | + * @param array $date_formats incoming date_formats in an array |
|
41 | + * where the first value is the date_format |
|
42 | + * and the second value is the time format |
|
43 | + * @return EE_Checkin |
|
44 | + * @throws EE_Error |
|
45 | + */ |
|
46 | + public static function new_instance($props_n_values = array(), $timezone = null, $date_formats = array()) |
|
47 | + { |
|
48 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone, $date_formats); |
|
49 | + return $has_object |
|
50 | + ? $has_object |
|
51 | + : new self($props_n_values, false, $timezone, $date_formats); |
|
52 | + } |
|
53 | + |
|
54 | + |
|
55 | + /** |
|
56 | + * @param array $props_n_values incoming values from the database |
|
57 | + * @param string $timezone incoming timezone as set by the model. If not set the timezone for |
|
58 | + * the website will be used. |
|
59 | + * @return EE_Checkin |
|
60 | + * @throws EE_Error |
|
61 | + */ |
|
62 | + public static function new_instance_from_db($props_n_values = array(), $timezone = null) |
|
63 | + { |
|
64 | + return new self($props_n_values, true, $timezone); |
|
65 | + } |
|
66 | + |
|
67 | + |
|
68 | + public function ID() |
|
69 | + { |
|
70 | + return $this->get('CHK_ID'); |
|
71 | + } |
|
72 | + |
|
73 | + |
|
74 | + public function registration_id() |
|
75 | + { |
|
76 | + return $this->get('REG_ID'); |
|
77 | + } |
|
78 | + |
|
79 | + |
|
80 | + public function datetime_id() |
|
81 | + { |
|
82 | + return $this->get('DTT_ID'); |
|
83 | + } |
|
84 | + |
|
85 | + |
|
86 | + public function status() |
|
87 | + { |
|
88 | + return $this->get('CHK_in'); |
|
89 | + } |
|
90 | + |
|
91 | + |
|
92 | + public function timestamp() |
|
93 | + { |
|
94 | + return $this->get('CHK_timestamp'); |
|
95 | + } |
|
96 | 96 | } |
@@ -6,23 +6,23 @@ |
||
6 | 6 | class EE_Event_Venue extends EE_Base_Class |
7 | 7 | { |
8 | 8 | |
9 | - /** |
|
10 | - * @param array $props_n_values |
|
11 | - * @return EE_Event_Venue|mixed |
|
12 | - */ |
|
13 | - public static function new_instance($props_n_values = array()) |
|
14 | - { |
|
15 | - $has_object = parent::_check_for_object($props_n_values, __CLASS__); |
|
16 | - return $has_object ? $has_object : new self($props_n_values); |
|
17 | - } |
|
9 | + /** |
|
10 | + * @param array $props_n_values |
|
11 | + * @return EE_Event_Venue|mixed |
|
12 | + */ |
|
13 | + public static function new_instance($props_n_values = array()) |
|
14 | + { |
|
15 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__); |
|
16 | + return $has_object ? $has_object : new self($props_n_values); |
|
17 | + } |
|
18 | 18 | |
19 | 19 | |
20 | - /** |
|
21 | - * @param array $props_n_values |
|
22 | - * @return EE_Event_Venue |
|
23 | - */ |
|
24 | - public static function new_instance_from_db($props_n_values = array()) |
|
25 | - { |
|
26 | - return new self($props_n_values, true); |
|
27 | - } |
|
20 | + /** |
|
21 | + * @param array $props_n_values |
|
22 | + * @return EE_Event_Venue |
|
23 | + */ |
|
24 | + public static function new_instance_from_db($props_n_values = array()) |
|
25 | + { |
|
26 | + return new self($props_n_values, true); |
|
27 | + } |
|
28 | 28 | } |
@@ -12,53 +12,53 @@ |
||
12 | 12 | { |
13 | 13 | |
14 | 14 | |
15 | - /** |
|
16 | - * Overrides parent _delete() so that we do soft deletes. |
|
17 | - * |
|
18 | - * @return bool|int |
|
19 | - */ |
|
20 | - protected function _delete() |
|
21 | - { |
|
22 | - return $this->delete_or_restore(); |
|
23 | - } |
|
15 | + /** |
|
16 | + * Overrides parent _delete() so that we do soft deletes. |
|
17 | + * |
|
18 | + * @return bool|int |
|
19 | + */ |
|
20 | + protected function _delete() |
|
21 | + { |
|
22 | + return $this->delete_or_restore(); |
|
23 | + } |
|
24 | 24 | |
25 | 25 | |
26 | - /** |
|
27 | - * Deletes or restores this object. |
|
28 | - * |
|
29 | - * @param bool $delete true=>delete, false=>restore |
|
30 | - * @return bool|int |
|
31 | - */ |
|
32 | - public function delete_or_restore($delete = true) |
|
33 | - { |
|
34 | - /** |
|
35 | - * Called just before trashing (soft delete) or restoring a trashed item. |
|
36 | - * |
|
37 | - * @param EE_Base_Class $model_object about to be trashed or restored |
|
38 | - * @param bool $delete true the item is being trashed, false the item is being restored. |
|
39 | - */ |
|
40 | - do_action('AHEE__EE_Soft_Delete_Base_Class__delete_or_restore__before', $this, $delete); |
|
41 | - $model = $this->get_model(); |
|
42 | - $result = $model->delete_or_restore_by_ID($delete, $this->ID()); |
|
43 | - /** |
|
44 | - * Called just after trashing (soft delete) or restoring a trashed item. |
|
45 | - * |
|
46 | - * @param EE_Base_Class $model_object that was just trashed or restored. |
|
47 | - * @param bool $delete true the item is being trashed, false the item is being restored. |
|
48 | - * @param bool|int $result |
|
49 | - */ |
|
50 | - do_action('AHEE__EE_Soft_Delete_Base_Class__delete_or_restore__after', $this, $delete, $result); |
|
51 | - return $result; |
|
52 | - } |
|
26 | + /** |
|
27 | + * Deletes or restores this object. |
|
28 | + * |
|
29 | + * @param bool $delete true=>delete, false=>restore |
|
30 | + * @return bool|int |
|
31 | + */ |
|
32 | + public function delete_or_restore($delete = true) |
|
33 | + { |
|
34 | + /** |
|
35 | + * Called just before trashing (soft delete) or restoring a trashed item. |
|
36 | + * |
|
37 | + * @param EE_Base_Class $model_object about to be trashed or restored |
|
38 | + * @param bool $delete true the item is being trashed, false the item is being restored. |
|
39 | + */ |
|
40 | + do_action('AHEE__EE_Soft_Delete_Base_Class__delete_or_restore__before', $this, $delete); |
|
41 | + $model = $this->get_model(); |
|
42 | + $result = $model->delete_or_restore_by_ID($delete, $this->ID()); |
|
43 | + /** |
|
44 | + * Called just after trashing (soft delete) or restoring a trashed item. |
|
45 | + * |
|
46 | + * @param EE_Base_Class $model_object that was just trashed or restored. |
|
47 | + * @param bool $delete true the item is being trashed, false the item is being restored. |
|
48 | + * @param bool|int $result |
|
49 | + */ |
|
50 | + do_action('AHEE__EE_Soft_Delete_Base_Class__delete_or_restore__after', $this, $delete, $result); |
|
51 | + return $result; |
|
52 | + } |
|
53 | 53 | |
54 | 54 | |
55 | - /** |
|
56 | - * Performs a restoration (un-deletes) this object |
|
57 | - * |
|
58 | - * @return bool|int |
|
59 | - */ |
|
60 | - public function restore() |
|
61 | - { |
|
62 | - return $this->delete_or_restore(false); |
|
63 | - } |
|
55 | + /** |
|
56 | + * Performs a restoration (un-deletes) this object |
|
57 | + * |
|
58 | + * @return bool|int |
|
59 | + */ |
|
60 | + public function restore() |
|
61 | + { |
|
62 | + return $this->delete_or_restore(false); |
|
63 | + } |
|
64 | 64 | } |
@@ -6,23 +6,23 @@ |
||
6 | 6 | class EE_Event_Question_Group extends EE_Base_Class |
7 | 7 | { |
8 | 8 | |
9 | - /** |
|
10 | - * @param array $props_n_values |
|
11 | - * @return EE_Event_Question_Group|mixed |
|
12 | - */ |
|
13 | - public static function new_instance($props_n_values = array()) |
|
14 | - { |
|
15 | - $has_object = parent::_check_for_object($props_n_values, __CLASS__); |
|
16 | - return $has_object ? $has_object : new self($props_n_values); |
|
17 | - } |
|
9 | + /** |
|
10 | + * @param array $props_n_values |
|
11 | + * @return EE_Event_Question_Group|mixed |
|
12 | + */ |
|
13 | + public static function new_instance($props_n_values = array()) |
|
14 | + { |
|
15 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__); |
|
16 | + return $has_object ? $has_object : new self($props_n_values); |
|
17 | + } |
|
18 | 18 | |
19 | 19 | |
20 | - /** |
|
21 | - * @param array $props_n_values |
|
22 | - * @return EE_Event_Question_Group |
|
23 | - */ |
|
24 | - public static function new_instance_from_db($props_n_values = array()) |
|
25 | - { |
|
26 | - return new self($props_n_values, true); |
|
27 | - } |
|
20 | + /** |
|
21 | + * @param array $props_n_values |
|
22 | + * @return EE_Event_Question_Group |
|
23 | + */ |
|
24 | + public static function new_instance_from_db($props_n_values = array()) |
|
25 | + { |
|
26 | + return new self($props_n_values, true); |
|
27 | + } |
|
28 | 28 | } |
@@ -12,142 +12,142 @@ |
||
12 | 12 | class EE_Status extends EE_Base_Class |
13 | 13 | { |
14 | 14 | |
15 | - /** |
|
16 | - * @param array $props_n_values |
|
17 | - * @return EE_Status |
|
18 | - */ |
|
19 | - public static function new_instance($props_n_values = array()) |
|
20 | - { |
|
21 | - $has_object = parent::_check_for_object($props_n_values, __CLASS__); |
|
22 | - return $has_object ? $has_object : new self($props_n_values); |
|
23 | - } |
|
24 | - |
|
25 | - |
|
26 | - /** |
|
27 | - * @param array $props_n_values |
|
28 | - * @return EE_Status |
|
29 | - */ |
|
30 | - public static function new_instance_from_db($props_n_values = array()) |
|
31 | - { |
|
32 | - return new self($props_n_values, true); |
|
33 | - } |
|
34 | - |
|
35 | - |
|
36 | - /** |
|
37 | - * Gets code |
|
38 | - * |
|
39 | - * @param bool $plural |
|
40 | - * @param string $schema |
|
41 | - * @return string |
|
42 | - */ |
|
43 | - public function code($plural = false, $schema = 'upper') |
|
44 | - { |
|
45 | - $id = $this->get('STS_ID'); |
|
46 | - $code = EEM_Status::instance()->localized_status(array($id => $this->get('STS_code')), $plural, $schema); |
|
47 | - return $code[ $id ]; |
|
48 | - } |
|
49 | - |
|
50 | - |
|
51 | - /** |
|
52 | - * Sets code |
|
53 | - * |
|
54 | - * @param string $code |
|
55 | - * @return boolean |
|
56 | - */ |
|
57 | - public function set_code($code) |
|
58 | - { |
|
59 | - $this->set('STS_code', $code); |
|
60 | - } |
|
61 | - |
|
62 | - |
|
63 | - /** |
|
64 | - * Gets desc |
|
65 | - * |
|
66 | - * @return string |
|
67 | - */ |
|
68 | - public function desc() |
|
69 | - { |
|
70 | - return $this->get('STS_desc'); |
|
71 | - } |
|
72 | - |
|
73 | - |
|
74 | - /** |
|
75 | - * Sets desc |
|
76 | - * |
|
77 | - * @param string $desc |
|
78 | - * @return boolean |
|
79 | - */ |
|
80 | - public function set_desc($desc) |
|
81 | - { |
|
82 | - $this->set('STS_desc', $desc); |
|
83 | - } |
|
84 | - |
|
85 | - |
|
86 | - /** |
|
87 | - * Gets type |
|
88 | - * |
|
89 | - * @return string |
|
90 | - */ |
|
91 | - public function type() |
|
92 | - { |
|
93 | - return $this->get('STS_type'); |
|
94 | - } |
|
95 | - |
|
96 | - |
|
97 | - /** |
|
98 | - * Sets type |
|
99 | - * |
|
100 | - * @param string $type |
|
101 | - * @return boolean |
|
102 | - */ |
|
103 | - public function set_type($type) |
|
104 | - { |
|
105 | - $this->set('STS_type', $type); |
|
106 | - } |
|
107 | - |
|
108 | - |
|
109 | - /** |
|
110 | - * Gets can_edit |
|
111 | - * |
|
112 | - * @return boolean |
|
113 | - */ |
|
114 | - public function can_edit() |
|
115 | - { |
|
116 | - return $this->get('STS_can_edit'); |
|
117 | - } |
|
118 | - |
|
119 | - |
|
120 | - /** |
|
121 | - * Sets can_edit |
|
122 | - * |
|
123 | - * @param boolean $can_edit |
|
124 | - * @return boolean |
|
125 | - */ |
|
126 | - public function set_can_edit($can_edit) |
|
127 | - { |
|
128 | - $this->set('STS_can_edit', $can_edit); |
|
129 | - } |
|
130 | - |
|
131 | - |
|
132 | - /** |
|
133 | - * Gets open |
|
134 | - * |
|
135 | - * @return boolean |
|
136 | - */ |
|
137 | - public function open() |
|
138 | - { |
|
139 | - return $this->get('STS_open'); |
|
140 | - } |
|
141 | - |
|
142 | - |
|
143 | - /** |
|
144 | - * Sets open |
|
145 | - * |
|
146 | - * @param boolean $open |
|
147 | - * @return boolean |
|
148 | - */ |
|
149 | - public function set_open($open) |
|
150 | - { |
|
151 | - $this->set('STS_open', $open); |
|
152 | - } |
|
15 | + /** |
|
16 | + * @param array $props_n_values |
|
17 | + * @return EE_Status |
|
18 | + */ |
|
19 | + public static function new_instance($props_n_values = array()) |
|
20 | + { |
|
21 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__); |
|
22 | + return $has_object ? $has_object : new self($props_n_values); |
|
23 | + } |
|
24 | + |
|
25 | + |
|
26 | + /** |
|
27 | + * @param array $props_n_values |
|
28 | + * @return EE_Status |
|
29 | + */ |
|
30 | + public static function new_instance_from_db($props_n_values = array()) |
|
31 | + { |
|
32 | + return new self($props_n_values, true); |
|
33 | + } |
|
34 | + |
|
35 | + |
|
36 | + /** |
|
37 | + * Gets code |
|
38 | + * |
|
39 | + * @param bool $plural |
|
40 | + * @param string $schema |
|
41 | + * @return string |
|
42 | + */ |
|
43 | + public function code($plural = false, $schema = 'upper') |
|
44 | + { |
|
45 | + $id = $this->get('STS_ID'); |
|
46 | + $code = EEM_Status::instance()->localized_status(array($id => $this->get('STS_code')), $plural, $schema); |
|
47 | + return $code[ $id ]; |
|
48 | + } |
|
49 | + |
|
50 | + |
|
51 | + /** |
|
52 | + * Sets code |
|
53 | + * |
|
54 | + * @param string $code |
|
55 | + * @return boolean |
|
56 | + */ |
|
57 | + public function set_code($code) |
|
58 | + { |
|
59 | + $this->set('STS_code', $code); |
|
60 | + } |
|
61 | + |
|
62 | + |
|
63 | + /** |
|
64 | + * Gets desc |
|
65 | + * |
|
66 | + * @return string |
|
67 | + */ |
|
68 | + public function desc() |
|
69 | + { |
|
70 | + return $this->get('STS_desc'); |
|
71 | + } |
|
72 | + |
|
73 | + |
|
74 | + /** |
|
75 | + * Sets desc |
|
76 | + * |
|
77 | + * @param string $desc |
|
78 | + * @return boolean |
|
79 | + */ |
|
80 | + public function set_desc($desc) |
|
81 | + { |
|
82 | + $this->set('STS_desc', $desc); |
|
83 | + } |
|
84 | + |
|
85 | + |
|
86 | + /** |
|
87 | + * Gets type |
|
88 | + * |
|
89 | + * @return string |
|
90 | + */ |
|
91 | + public function type() |
|
92 | + { |
|
93 | + return $this->get('STS_type'); |
|
94 | + } |
|
95 | + |
|
96 | + |
|
97 | + /** |
|
98 | + * Sets type |
|
99 | + * |
|
100 | + * @param string $type |
|
101 | + * @return boolean |
|
102 | + */ |
|
103 | + public function set_type($type) |
|
104 | + { |
|
105 | + $this->set('STS_type', $type); |
|
106 | + } |
|
107 | + |
|
108 | + |
|
109 | + /** |
|
110 | + * Gets can_edit |
|
111 | + * |
|
112 | + * @return boolean |
|
113 | + */ |
|
114 | + public function can_edit() |
|
115 | + { |
|
116 | + return $this->get('STS_can_edit'); |
|
117 | + } |
|
118 | + |
|
119 | + |
|
120 | + /** |
|
121 | + * Sets can_edit |
|
122 | + * |
|
123 | + * @param boolean $can_edit |
|
124 | + * @return boolean |
|
125 | + */ |
|
126 | + public function set_can_edit($can_edit) |
|
127 | + { |
|
128 | + $this->set('STS_can_edit', $can_edit); |
|
129 | + } |
|
130 | + |
|
131 | + |
|
132 | + /** |
|
133 | + * Gets open |
|
134 | + * |
|
135 | + * @return boolean |
|
136 | + */ |
|
137 | + public function open() |
|
138 | + { |
|
139 | + return $this->get('STS_open'); |
|
140 | + } |
|
141 | + |
|
142 | + |
|
143 | + /** |
|
144 | + * Sets open |
|
145 | + * |
|
146 | + * @param boolean $open |
|
147 | + * @return boolean |
|
148 | + */ |
|
149 | + public function set_open($open) |
|
150 | + { |
|
151 | + $this->set('STS_open', $open); |
|
152 | + } |
|
153 | 153 | } |
@@ -44,7 +44,7 @@ |
||
44 | 44 | { |
45 | 45 | $id = $this->get('STS_ID'); |
46 | 46 | $code = EEM_Status::instance()->localized_status(array($id => $this->get('STS_code')), $plural, $schema); |
47 | - return $code[ $id ]; |
|
47 | + return $code[$id]; |
|
48 | 48 | } |
49 | 49 | |
50 | 50 |