PluginProbe
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder / 2.17.6
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder v2.17.6
V-3.3.0 3.2.2 3.2.1 3.2.0 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 V3.0.3 V3.0.2 -3.0.1 V_3.0.0 1.1.1 1.1.8 1.2 1.3 1.4 1.4.18 1.5.2 1.9 2.0 2.10.0 2.10.1 2.10.2 All 137 releases
← All changes | includes/Core/Database/FormEntryModel.php +38 -34 1.32.17.6 View file →
@@ -1,49 +1,53 @@
1 1 <?php
2 +
2 3 /**
3 4 * Provides Base Model Class
4 5 */
6 +
5 7 namespace BitCode\BitForm\Core\Database;
6 8
7 9 /**
8 10 * Undocumented class
9 11 */
12 +
10 13 use WP_Error;
11 -use BitCode\BitForm\Core\Database\Model;
14 +
12 15 class FormEntryModel extends Model
13 16 {
14 - protected static $table = 'bitforms_form_entries';
17 + protected static $table = 'bitforms_form_entries';
15 18
16 - public function bulkDelete(array $condition = null)
17 - {
18 - if (!\is_null($condition)
19 - && \is_array($condition)
20 - && array_keys($condition) !== range(0, count($condition) - 1)
21 - ) {
22 - $delete_condition = $condition;
23 - } else {
24 - return new WP_Error(
25 - 'deletion_error',
26 - __('At least 1 condition needed', 'bitform')
27 - );
28 - }
29 - $formatted_conditions = $this->getFormatedCondition($delete_condition);
30 - if ($formatted_conditions) {
31 - $condition_to_check = $formatted_conditions['conditions'];
32 - $all_values = $formatted_conditions['values'];
33 - } else {
34 - $condition_to_check = null;
35 - return new WP_Error(
36 - 'deletion_error',
37 - __('At least 1 condition needed', 'bitform')
38 - );
39 - }
40 - $prefix = $this->app_db->prefix;
41 - $sql = "DELETE `{$prefix}bitforms_form_entries`,`{$prefix}bitforms_form_entrymeta` FROM "
42 - ."`{$prefix}bitforms_form_entries` "
43 - ." INNER JOIN `{$prefix}bitforms_form_entrymeta` ON "
44 - ." `{$prefix}bitforms_form_entries`.`id` "
45 - ."= `{$prefix}bitforms_form_entrymeta`.`bitforms_form_entry_id` "
46 - ." $condition_to_check";
47 - return $this->execute($sql, $all_values)->getResult();
19 + public function bulkDelete(array $condition = null)
20 + {
21 + if (
22 + !\is_null($condition)
23 + && \is_array($condition)
24 + && array_keys($condition) !== range(0, count($condition) - 1)
25 + ) {
26 + $delete_condition = $condition;
27 + } else {
28 + return new WP_Error(
29 + 'deletion_error',
30 + __('At least 1 condition needed', 'bit-form')
31 + );
48 32 }
33 + $formatted_conditions = $this->getFormatedCondition($delete_condition);
34 + if ($formatted_conditions) {
35 + $condition_to_check = $formatted_conditions['conditions'];
36 + $all_values = $formatted_conditions['values'];
37 + } else {
38 + $condition_to_check = null;
39 + return new WP_Error(
40 + 'deletion_error',
41 + __('At least 1 condition needed', 'bit-form')
42 + );
43 + }
44 + $prefix = $this->app_db->prefix;
45 + $sql = "DELETE `{$prefix}bitforms_form_entries`,`{$prefix}bitforms_form_entrymeta` FROM "
46 + . "`{$prefix}bitforms_form_entries` "
47 + . " INNER JOIN `{$prefix}bitforms_form_entrymeta` ON "
48 + . " `{$prefix}bitforms_form_entries`.`id` "
49 + . "= `{$prefix}bitforms_form_entrymeta`.`bitforms_form_entry_id` "
50 + . " $condition_to_check";
51 + return $this->execute($sql, $all_values)->getResult();
52 + }
49 53 }