Completed
Branch dev (3b3c60)
by
unknown
44:42 queued 33:59
created
core/db_models/EEM_Question_Group.model.php 2 patches
Indentation   +122 added lines, -122 removed lines patch added patch discarded remove patch
@@ -10,134 +10,134 @@
 block discarded – undo
10 10
 class EEM_Question_Group extends EEM_Soft_Delete_Base
11 11
 {
12 12
 
13
-    const system_personal = 1;
13
+	const system_personal = 1;
14 14
 
15
-    const system_address = 2;
15
+	const system_address = 2;
16 16
 
17
-    /**
18
-     * private instance of the EEM_Question_Group object
19
-     *
20
-     * @var EEM_Question_Group
21
-     */
22
-    protected static $_instance = null;
17
+	/**
18
+	 * private instance of the EEM_Question_Group object
19
+	 *
20
+	 * @var EEM_Question_Group
21
+	 */
22
+	protected static $_instance = null;
23 23
 
24 24
 
25
-    /**
26
-     * EEM_Question_Group constructor.
27
-     *
28
-     * @param string|null $timezone
29
-     */
30
-    protected function __construct($timezone = null)
31
-    {
32
-        $this->singular_item = esc_html__('Question Group', 'event_espresso');
33
-        $this->plural_item   = esc_html__('Question Groups', 'event_espresso');
25
+	/**
26
+	 * EEM_Question_Group constructor.
27
+	 *
28
+	 * @param string|null $timezone
29
+	 */
30
+	protected function __construct($timezone = null)
31
+	{
32
+		$this->singular_item = esc_html__('Question Group', 'event_espresso');
33
+		$this->plural_item   = esc_html__('Question Groups', 'event_espresso');
34 34
 
35
-        $this->_tables          = [
36
-            'Question_Group' => new EE_Primary_Table('esp_question_group', 'QSG_ID'),
37
-        ];
38
-        $this->_fields          = [
39
-            'Question_Group' => [
40
-                'QSG_ID'              => new EE_Primary_Key_Int_Field(
41
-                    'QSG_ID',
42
-                    esc_html__('Question Group ID', 'event_espresso')
43
-                ),
44
-                'QSG_name'            => new EE_Plain_Text_Field(
45
-                    'QSG_name',
46
-                    esc_html__('Question Group Name', 'event_espresso'),
47
-                    false,
48
-                    ''
49
-                ),
50
-                'QSG_identifier'      => new EE_Plain_Text_Field(
51
-                    'QSG_identifier',
52
-                    esc_html__('Text ID for question Group', 'event_espresso'),
53
-                    false,
54
-                    ''
55
-                ),
56
-                'QSG_desc'            => new EE_Post_Content_Field(
57
-                    'QSG_desc',
58
-                    esc_html__('Description of Question Group', 'event_espresso'),
59
-                    true,
60
-                    ''
61
-                ),
62
-                'QSG_order'           => new EE_Integer_Field(
63
-                    'QSG_order',
64
-                    esc_html__('Order in which to show the question group', 'event_espresso'),
65
-                    true,
66
-                    0
67
-                ),
68
-                'QSG_show_group_name' => new EE_Boolean_Field(
69
-                    'QSG_show_group_name',
70
-                    esc_html__(
71
-                        'Flag indicating whether to show the group\'s name on the registration page',
72
-                        'event_espresso'
73
-                    ),
74
-                    false,
75
-                    true
76
-                ),
77
-                'QSG_show_group_desc' => new EE_Boolean_Field(
78
-                    'QSG_show_group_desc',
79
-                    esc_html__(
80
-                        'Flag indicating whether to show the group\s description on the registration page',
81
-                        'event_espresso'
82
-                    ), false,
83
-                    false
84
-                ),
85
-                'QSG_wp_user'         => new EE_WP_User_Field(
86
-                    'QSG_wp_user',
87
-                    esc_html__('Question Group Creator ID', 'event_espresso'),
88
-                    false
89
-                ),
90
-                'QSG_system'          => new EE_Integer_Field(
91
-                    'QSG_system',
92
-                    esc_html__(
93
-                        'Indicate IF this is a system group and if it is what system group it corresponds to.',
94
-                        'event_espresso'
95
-                    ), false,
96
-                    0
97
-                ),
98
-                'QSG_deleted'         => new EE_Trashed_Flag_Field(
99
-                    'QSG_deleted',
100
-                    esc_html__('Flag indicating this question group was deleted', 'event_espresso'),
101
-                    false,
102
-                    false
103
-                ),
104
-            ],
105
-        ];
106
-        $this->_model_relations = [
107
-            'Question'             => new EE_HABTM_Relation('Question_Group_Question'),
108
-            'Event'                => new EE_HABTM_Relation('Event_Question_Group'),
109
-            'Event_Question_Group' => new EE_Has_Many_Relation(),
110
-            'WP_User'              => new EE_Belongs_To_Relation(),
111
-        ];
112
-        // this model is generally available for reading
113
-        $this->_cap_restriction_generators[ EEM_Base::caps_read ]       =
114
-            new EE_Restriction_Generator_Public();
115
-        $this->_cap_restriction_generators[ EEM_Base::caps_read_admin ] =
116
-            new EE_Restriction_Generator_Reg_Form('QSG_system');
117
-        $this->_cap_restriction_generators[ EEM_Base::caps_edit ]       =
118
-            new EE_Restriction_Generator_Reg_Form('QSG_system');
119
-        $this->_cap_restriction_generators[ EEM_Base::caps_delete ]     =
120
-            new EE_Restriction_Generator_Reg_Form('QSG_system');
35
+		$this->_tables          = [
36
+			'Question_Group' => new EE_Primary_Table('esp_question_group', 'QSG_ID'),
37
+		];
38
+		$this->_fields          = [
39
+			'Question_Group' => [
40
+				'QSG_ID'              => new EE_Primary_Key_Int_Field(
41
+					'QSG_ID',
42
+					esc_html__('Question Group ID', 'event_espresso')
43
+				),
44
+				'QSG_name'            => new EE_Plain_Text_Field(
45
+					'QSG_name',
46
+					esc_html__('Question Group Name', 'event_espresso'),
47
+					false,
48
+					''
49
+				),
50
+				'QSG_identifier'      => new EE_Plain_Text_Field(
51
+					'QSG_identifier',
52
+					esc_html__('Text ID for question Group', 'event_espresso'),
53
+					false,
54
+					''
55
+				),
56
+				'QSG_desc'            => new EE_Post_Content_Field(
57
+					'QSG_desc',
58
+					esc_html__('Description of Question Group', 'event_espresso'),
59
+					true,
60
+					''
61
+				),
62
+				'QSG_order'           => new EE_Integer_Field(
63
+					'QSG_order',
64
+					esc_html__('Order in which to show the question group', 'event_espresso'),
65
+					true,
66
+					0
67
+				),
68
+				'QSG_show_group_name' => new EE_Boolean_Field(
69
+					'QSG_show_group_name',
70
+					esc_html__(
71
+						'Flag indicating whether to show the group\'s name on the registration page',
72
+						'event_espresso'
73
+					),
74
+					false,
75
+					true
76
+				),
77
+				'QSG_show_group_desc' => new EE_Boolean_Field(
78
+					'QSG_show_group_desc',
79
+					esc_html__(
80
+						'Flag indicating whether to show the group\s description on the registration page',
81
+						'event_espresso'
82
+					), false,
83
+					false
84
+				),
85
+				'QSG_wp_user'         => new EE_WP_User_Field(
86
+					'QSG_wp_user',
87
+					esc_html__('Question Group Creator ID', 'event_espresso'),
88
+					false
89
+				),
90
+				'QSG_system'          => new EE_Integer_Field(
91
+					'QSG_system',
92
+					esc_html__(
93
+						'Indicate IF this is a system group and if it is what system group it corresponds to.',
94
+						'event_espresso'
95
+					), false,
96
+					0
97
+				),
98
+				'QSG_deleted'         => new EE_Trashed_Flag_Field(
99
+					'QSG_deleted',
100
+					esc_html__('Flag indicating this question group was deleted', 'event_espresso'),
101
+					false,
102
+					false
103
+				),
104
+			],
105
+		];
106
+		$this->_model_relations = [
107
+			'Question'             => new EE_HABTM_Relation('Question_Group_Question'),
108
+			'Event'                => new EE_HABTM_Relation('Event_Question_Group'),
109
+			'Event_Question_Group' => new EE_Has_Many_Relation(),
110
+			'WP_User'              => new EE_Belongs_To_Relation(),
111
+		];
112
+		// this model is generally available for reading
113
+		$this->_cap_restriction_generators[ EEM_Base::caps_read ]       =
114
+			new EE_Restriction_Generator_Public();
115
+		$this->_cap_restriction_generators[ EEM_Base::caps_read_admin ] =
116
+			new EE_Restriction_Generator_Reg_Form('QSG_system');
117
+		$this->_cap_restriction_generators[ EEM_Base::caps_edit ]       =
118
+			new EE_Restriction_Generator_Reg_Form('QSG_system');
119
+		$this->_cap_restriction_generators[ EEM_Base::caps_delete ]     =
120
+			new EE_Restriction_Generator_Reg_Form('QSG_system');
121 121
 
122
-        parent::__construct($timezone);
123
-    }
122
+		parent::__construct($timezone);
123
+	}
124 124
 
125 125
 
126
-    /**
127
-     * searches the db for the question group with the latest question order and returns that value.
128
-     *
129
-     * @return int
130
-     * @throws EE_Error
131
-     */
132
-    public function get_latest_question_group_order()
133
-    {
134
-        $max = $this->_get_all_wpdb_results(
135
-            [],
136
-            ARRAY_A,
137
-            [
138
-                'max_order' => ["MAX(QSG_order)", "%d"],
139
-            ]
140
-        );
141
-        return $max[0]['max_order'];
142
-    }
126
+	/**
127
+	 * searches the db for the question group with the latest question order and returns that value.
128
+	 *
129
+	 * @return int
130
+	 * @throws EE_Error
131
+	 */
132
+	public function get_latest_question_group_order()
133
+	{
134
+		$max = $this->_get_all_wpdb_results(
135
+			[],
136
+			ARRAY_A,
137
+			[
138
+				'max_order' => ["MAX(QSG_order)", "%d"],
139
+			]
140
+		);
141
+		return $max[0]['max_order'];
142
+	}
143 143
 }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -110,13 +110,13 @@
 block discarded – undo
110 110
             'WP_User'              => new EE_Belongs_To_Relation(),
111 111
         ];
112 112
         // this model is generally available for reading
113
-        $this->_cap_restriction_generators[ EEM_Base::caps_read ]       =
113
+        $this->_cap_restriction_generators[EEM_Base::caps_read]       =
114 114
             new EE_Restriction_Generator_Public();
115
-        $this->_cap_restriction_generators[ EEM_Base::caps_read_admin ] =
115
+        $this->_cap_restriction_generators[EEM_Base::caps_read_admin] =
116 116
             new EE_Restriction_Generator_Reg_Form('QSG_system');
117
-        $this->_cap_restriction_generators[ EEM_Base::caps_edit ]       =
117
+        $this->_cap_restriction_generators[EEM_Base::caps_edit]       =
118 118
             new EE_Restriction_Generator_Reg_Form('QSG_system');
119
-        $this->_cap_restriction_generators[ EEM_Base::caps_delete ]     =
119
+        $this->_cap_restriction_generators[EEM_Base::caps_delete]     =
120 120
             new EE_Restriction_Generator_Reg_Form('QSG_system');
121 121
 
122 122
         parent::__construct($timezone);
Please login to merge, or discard this patch.