Completed
Branch new-admin-design (7f58b2)
by
unknown
02:54
created
core/domain/services/graphql/connections/RootQueryPricesConnection.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,8 +38,8 @@
 block discarded – undo
38 38
     {
39 39
         return [
40 40
             'fromType'           => 'RootQuery',
41
-            'toType'             => $this->namespace . 'Price',
42
-            'fromFieldName'      => lcfirst($this->namespace) . 'Prices',
41
+            'toType'             => $this->namespace.'Price',
42
+            'fromFieldName'      => lcfirst($this->namespace).'Prices',
43 43
             'connectionTypeName' => "{$this->namespace}RootQueryPricesConnection",
44 44
             'connectionArgs'     => TicketPricesConnection::get_connection_args(),
45 45
             'resolve'            => [$this, 'resolveConnection'],
Please login to merge, or discard this patch.
Indentation   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -20,43 +20,43 @@
 block discarded – undo
20 20
 {
21 21
 
22 22
 
23
-    /**
24
-     * PriceConnection constructor.
25
-     *
26
-     * @param EEM_Price               $model
27
-     */
28
-    public function __construct(EEM_Price $model)
29
-    {
30
-        parent::__construct($model);
31
-    }
32
-
33
-
34
-    /**
35
-     * @return array
36
-     */
37
-    public function config(): array
38
-    {
39
-        return [
40
-            'fromType'           => 'RootQuery',
41
-            'toType'             => $this->namespace . 'Price',
42
-            'fromFieldName'      => lcfirst($this->namespace) . 'Prices',
43
-            'connectionTypeName' => "{$this->namespace}RootQueryPricesConnection",
44
-            'connectionArgs'     => TicketPricesConnection::get_connection_args(),
45
-            'resolve'            => [$this, 'resolveConnection'],
46
-        ];
47
-    }
48
-
49
-
50
-    /**
51
-     * @param $entity
52
-     * @param $args
53
-     * @param $context
54
-     * @param $info
55
-     * @return PriceConnectionResolver
56
-     * @throws Exception
57
-     */
58
-    public function getConnectionResolver($entity, $args, $context, $info): AbstractConnectionResolver
59
-    {
60
-        return new PriceConnectionResolver($entity, $args, $context, $info);
61
-    }
23
+	/**
24
+	 * PriceConnection constructor.
25
+	 *
26
+	 * @param EEM_Price               $model
27
+	 */
28
+	public function __construct(EEM_Price $model)
29
+	{
30
+		parent::__construct($model);
31
+	}
32
+
33
+
34
+	/**
35
+	 * @return array
36
+	 */
37
+	public function config(): array
38
+	{
39
+		return [
40
+			'fromType'           => 'RootQuery',
41
+			'toType'             => $this->namespace . 'Price',
42
+			'fromFieldName'      => lcfirst($this->namespace) . 'Prices',
43
+			'connectionTypeName' => "{$this->namespace}RootQueryPricesConnection",
44
+			'connectionArgs'     => TicketPricesConnection::get_connection_args(),
45
+			'resolve'            => [$this, 'resolveConnection'],
46
+		];
47
+	}
48
+
49
+
50
+	/**
51
+	 * @param $entity
52
+	 * @param $args
53
+	 * @param $context
54
+	 * @param $info
55
+	 * @return PriceConnectionResolver
56
+	 * @throws Exception
57
+	 */
58
+	public function getConnectionResolver($entity, $args, $context, $info): AbstractConnectionResolver
59
+	{
60
+		return new PriceConnectionResolver($entity, $args, $context, $info);
61
+	}
62 62
 }
Please login to merge, or discard this patch.
core/domain/services/graphql/connections/RootQueryDatetimesConnection.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,8 +38,8 @@
 block discarded – undo
38 38
     {
39 39
         return [
40 40
             'fromType'           => 'RootQuery',
41
-            'toType'             => $this->namespace . 'Datetime',
42
-            'fromFieldName'      => lcfirst($this->namespace . 'Datetimes'),
41
+            'toType'             => $this->namespace.'Datetime',
42
+            'fromFieldName'      => lcfirst($this->namespace.'Datetimes'),
43 43
             'connectionTypeName' => "{$this->namespace}RootQueryDatetimesConnection",
44 44
             'connectionArgs'     => EventDatetimesConnection::get_connection_args(),
45 45
             'resolve'            => [$this, 'resolveConnection'],
Please login to merge, or discard this patch.
Indentation   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -20,43 +20,43 @@
 block discarded – undo
20 20
 {
21 21
 
22 22
 
23
-    /**
24
-     * DatetimeConnection constructor.
25
-     *
26
-     * @param EEM_Datetime               $model
27
-     */
28
-    public function __construct(EEM_Datetime $model)
29
-    {
30
-        parent::__construct($model);
31
-    }
32
-
33
-
34
-    /**
35
-     * @return array
36
-     */
37
-    public function config(): array
38
-    {
39
-        return [
40
-            'fromType'           => 'RootQuery',
41
-            'toType'             => $this->namespace . 'Datetime',
42
-            'fromFieldName'      => lcfirst($this->namespace . 'Datetimes'),
43
-            'connectionTypeName' => "{$this->namespace}RootQueryDatetimesConnection",
44
-            'connectionArgs'     => EventDatetimesConnection::get_connection_args(),
45
-            'resolve'            => [$this, 'resolveConnection'],
46
-        ];
47
-    }
48
-
49
-
50
-    /**
51
-     * @param $entity
52
-     * @param $args
53
-     * @param $context
54
-     * @param $info
55
-     * @return DatetimeConnectionResolver
56
-     * @throws Exception
57
-     */
58
-    public function getConnectionResolver($entity, $args, $context, $info): AbstractConnectionResolver
59
-    {
60
-        return new DatetimeConnectionResolver($entity, $args, $context, $info);
61
-    }
23
+	/**
24
+	 * DatetimeConnection constructor.
25
+	 *
26
+	 * @param EEM_Datetime               $model
27
+	 */
28
+	public function __construct(EEM_Datetime $model)
29
+	{
30
+		parent::__construct($model);
31
+	}
32
+
33
+
34
+	/**
35
+	 * @return array
36
+	 */
37
+	public function config(): array
38
+	{
39
+		return [
40
+			'fromType'           => 'RootQuery',
41
+			'toType'             => $this->namespace . 'Datetime',
42
+			'fromFieldName'      => lcfirst($this->namespace . 'Datetimes'),
43
+			'connectionTypeName' => "{$this->namespace}RootQueryDatetimesConnection",
44
+			'connectionArgs'     => EventDatetimesConnection::get_connection_args(),
45
+			'resolve'            => [$this, 'resolveConnection'],
46
+		];
47
+	}
48
+
49
+
50
+	/**
51
+	 * @param $entity
52
+	 * @param $args
53
+	 * @param $context
54
+	 * @param $info
55
+	 * @return DatetimeConnectionResolver
56
+	 * @throws Exception
57
+	 */
58
+	public function getConnectionResolver($entity, $args, $context, $info): AbstractConnectionResolver
59
+	{
60
+		return new DatetimeConnectionResolver($entity, $args, $context, $info);
61
+	}
62 62
 }
Please login to merge, or discard this patch.
core/domain/services/graphql/connections/RootQueryTicketsConnection.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,8 +38,8 @@
 block discarded – undo
38 38
     {
39 39
         return [
40 40
             'fromType'           => 'RootQuery',
41
-            'toType'             => $this->namespace . 'Ticket',
42
-            'fromFieldName'      => lcfirst($this->namespace) . 'Tickets',
41
+            'toType'             => $this->namespace.'Ticket',
42
+            'fromFieldName'      => lcfirst($this->namespace).'Tickets',
43 43
             'connectionTypeName' => "{$this->namespace}RootQueryTicketsConnection",
44 44
             'connectionArgs'     => DatetimeTicketsConnection::get_connection_args(),
45 45
             'resolve'            => [$this, 'resolveConnection'],
Please login to merge, or discard this patch.
Indentation   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -20,43 +20,43 @@
 block discarded – undo
20 20
 {
21 21
 
22 22
 
23
-    /**
24
-     * TicketConnection constructor.
25
-     *
26
-     * @param EEM_Ticket               $model
27
-     */
28
-    public function __construct(EEM_Ticket $model)
29
-    {
30
-        parent::__construct($model);
31
-    }
32
-
33
-
34
-    /**
35
-     * @return array
36
-     */
37
-    public function config(): array
38
-    {
39
-        return [
40
-            'fromType'           => 'RootQuery',
41
-            'toType'             => $this->namespace . 'Ticket',
42
-            'fromFieldName'      => lcfirst($this->namespace) . 'Tickets',
43
-            'connectionTypeName' => "{$this->namespace}RootQueryTicketsConnection",
44
-            'connectionArgs'     => DatetimeTicketsConnection::get_connection_args(),
45
-            'resolve'            => [$this, 'resolveConnection'],
46
-        ];
47
-    }
48
-
49
-
50
-    /**
51
-     * @param $entity
52
-     * @param $args
53
-     * @param $context
54
-     * @param $info
55
-     * @return TicketConnectionResolver
56
-     * @throws Exception
57
-     */
58
-    public function getConnectionResolver($entity, $args, $context, $info): AbstractConnectionResolver
59
-    {
60
-        return new TicketConnectionResolver($entity, $args, $context, $info);
61
-    }
23
+	/**
24
+	 * TicketConnection constructor.
25
+	 *
26
+	 * @param EEM_Ticket               $model
27
+	 */
28
+	public function __construct(EEM_Ticket $model)
29
+	{
30
+		parent::__construct($model);
31
+	}
32
+
33
+
34
+	/**
35
+	 * @return array
36
+	 */
37
+	public function config(): array
38
+	{
39
+		return [
40
+			'fromType'           => 'RootQuery',
41
+			'toType'             => $this->namespace . 'Ticket',
42
+			'fromFieldName'      => lcfirst($this->namespace) . 'Tickets',
43
+			'connectionTypeName' => "{$this->namespace}RootQueryTicketsConnection",
44
+			'connectionArgs'     => DatetimeTicketsConnection::get_connection_args(),
45
+			'resolve'            => [$this, 'resolveConnection'],
46
+		];
47
+	}
48
+
49
+
50
+	/**
51
+	 * @param $entity
52
+	 * @param $args
53
+	 * @param $context
54
+	 * @param $info
55
+	 * @return TicketConnectionResolver
56
+	 * @throws Exception
57
+	 */
58
+	public function getConnectionResolver($entity, $args, $context, $info): AbstractConnectionResolver
59
+	{
60
+		return new TicketConnectionResolver($entity, $args, $context, $info);
61
+	}
62 62
 }
Please login to merge, or discard this patch.
core/services/graphql/inputs/InputBase.php 1 patch
Indentation   +93 added lines, -93 removed lines patch added patch discarded remove patch
@@ -16,97 +16,97 @@
 block discarded – undo
16 16
 abstract class InputBase implements InputInterface
17 17
 {
18 18
 
19
-    /**
20
-     * @var string $namespace The graphql namespace/prefix.
21
-     */
22
-    protected $namespace = 'Espresso';
23
-
24
-    /**
25
-     * @var string $name
26
-     */
27
-    protected $name = '';
28
-
29
-    /**
30
-     * @var string $description
31
-     */
32
-    protected $description = '';
33
-
34
-    /**
35
-     * @var GraphQLFieldInterface[] $fields
36
-     */
37
-    protected $fields = [];
38
-
39
-    /**
40
-     * InputBase constructor.
41
-     */
42
-    public function __construct()
43
-    {
44
-        $this->setFields($this->getFields());
45
-    }
46
-
47
-
48
-    /**
49
-     * @return GraphQLFieldInterface[]
50
-     * @since $VID:$
51
-     */
52
-    abstract protected function getFields();
53
-
54
-
55
-    /**
56
-     * @return string
57
-     */
58
-    public function name()
59
-    {
60
-        return $this->name;
61
-    }
62
-
63
-
64
-    /**
65
-     * @param string $name
66
-     */
67
-    protected function setName($name)
68
-    {
69
-        $this->name = $name;
70
-    }
71
-
72
-
73
-    /**
74
-     * @return string
75
-     */
76
-    public function description()
77
-    {
78
-        return $this->description;
79
-    }
80
-
81
-
82
-    /**
83
-     * @param string $description
84
-     */
85
-    protected function setDescription($description)
86
-    {
87
-        $this->description = $description;
88
-    }
89
-
90
-
91
-    /**
92
-     * @return GraphQLFieldInterface[]
93
-     * @since $VID:$
94
-     */
95
-    public function fields()
96
-    {
97
-        return (array) $this->fields;
98
-    }
99
-
100
-
101
-    /**
102
-     * @param GraphQLFieldInterface[] $fields
103
-     */
104
-    protected function setFields(array $fields)
105
-    {
106
-        foreach ($fields as $field) {
107
-            if ($field instanceof GraphQLField) {
108
-                $this->fields[] = $field;
109
-            }
110
-        }
111
-    }
19
+	/**
20
+	 * @var string $namespace The graphql namespace/prefix.
21
+	 */
22
+	protected $namespace = 'Espresso';
23
+
24
+	/**
25
+	 * @var string $name
26
+	 */
27
+	protected $name = '';
28
+
29
+	/**
30
+	 * @var string $description
31
+	 */
32
+	protected $description = '';
33
+
34
+	/**
35
+	 * @var GraphQLFieldInterface[] $fields
36
+	 */
37
+	protected $fields = [];
38
+
39
+	/**
40
+	 * InputBase constructor.
41
+	 */
42
+	public function __construct()
43
+	{
44
+		$this->setFields($this->getFields());
45
+	}
46
+
47
+
48
+	/**
49
+	 * @return GraphQLFieldInterface[]
50
+	 * @since $VID:$
51
+	 */
52
+	abstract protected function getFields();
53
+
54
+
55
+	/**
56
+	 * @return string
57
+	 */
58
+	public function name()
59
+	{
60
+		return $this->name;
61
+	}
62
+
63
+
64
+	/**
65
+	 * @param string $name
66
+	 */
67
+	protected function setName($name)
68
+	{
69
+		$this->name = $name;
70
+	}
71
+
72
+
73
+	/**
74
+	 * @return string
75
+	 */
76
+	public function description()
77
+	{
78
+		return $this->description;
79
+	}
80
+
81
+
82
+	/**
83
+	 * @param string $description
84
+	 */
85
+	protected function setDescription($description)
86
+	{
87
+		$this->description = $description;
88
+	}
89
+
90
+
91
+	/**
92
+	 * @return GraphQLFieldInterface[]
93
+	 * @since $VID:$
94
+	 */
95
+	public function fields()
96
+	{
97
+		return (array) $this->fields;
98
+	}
99
+
100
+
101
+	/**
102
+	 * @param GraphQLFieldInterface[] $fields
103
+	 */
104
+	protected function setFields(array $fields)
105
+	{
106
+		foreach ($fields as $field) {
107
+			if ($field instanceof GraphQLField) {
108
+				$this->fields[] = $field;
109
+			}
110
+		}
111
+	}
112 112
 }
Please login to merge, or discard this patch.
core/libraries/batch/JobHandlers/ExecuteBatchDeletion.php 2 patches
Indentation   +148 added lines, -148 removed lines patch added patch discarded remove patch
@@ -32,158 +32,158 @@
 block discarded – undo
32 32
  */
33 33
 class ExecuteBatchDeletion extends JobHandler
34 34
 {
35
-    /**
36
-     * @var NodeGroupDao
37
-     */
38
-    protected $model_obj_node_group_persister;
39
-    public function __construct(NodeGroupDao $model_obj_node_group_persister)
40
-    {
41
-        $this->model_obj_node_group_persister = $model_obj_node_group_persister;
42
-    }
35
+	/**
36
+	 * @var NodeGroupDao
37
+	 */
38
+	protected $model_obj_node_group_persister;
39
+	public function __construct(NodeGroupDao $model_obj_node_group_persister)
40
+	{
41
+		$this->model_obj_node_group_persister = $model_obj_node_group_persister;
42
+	}
43 43
 
44 44
 
45
-    // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
46
-    /**
47
-     *
48
-     * @param JobParameters $job_parameters
49
-     * @throws BatchRequestException
50
-     * @return JobStepResponse
51
-     */
52
-    public function create_job(JobParameters $job_parameters)
53
-    {
54
-        $deletion_job_code = $job_parameters->request_datum('deletion_job_code', null);
55
-        $roots = $this->model_obj_node_group_persister->getModelObjNodesInGroup($deletion_job_code);
56
-        if ($roots === null) {
57
-            throw new UnexpectedEntityException($roots, 'array', esc_html__('The job seems to be stale. Please press the back button in your browser twice.', 'event_espresso'));
58
-        }
59
-        $models_and_ids_to_delete = [];
60
-        foreach ($roots as $root) {
61
-            if (! $root instanceof ModelObjNode) {
62
-                throw new UnexpectedEntityException($root, 'ModelObjNode');
63
-            }
64
-            $models_and_ids_to_delete = array_replace_recursive($models_and_ids_to_delete, $root->getIds());
65
-        }
66
-        $job_parameters->set_extra_data(
67
-            [
68
-                'models_and_ids_to_delete' => $models_and_ids_to_delete
69
-            ]
70
-        );
71
-        // Find the job's actual size.
72
-        $job_size = 0;
73
-        foreach ($models_and_ids_to_delete as $model_name => $ids) {
74
-            $job_size += count($ids);
75
-        }
76
-        $job_parameters->set_job_size($job_size);
77
-        return new JobStepResponse(
78
-            $job_parameters,
79
-            esc_html__('Beginning to delete items...', 'event_espresso')
80
-        );
81
-    }
45
+	// phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
46
+	/**
47
+	 *
48
+	 * @param JobParameters $job_parameters
49
+	 * @throws BatchRequestException
50
+	 * @return JobStepResponse
51
+	 */
52
+	public function create_job(JobParameters $job_parameters)
53
+	{
54
+		$deletion_job_code = $job_parameters->request_datum('deletion_job_code', null);
55
+		$roots = $this->model_obj_node_group_persister->getModelObjNodesInGroup($deletion_job_code);
56
+		if ($roots === null) {
57
+			throw new UnexpectedEntityException($roots, 'array', esc_html__('The job seems to be stale. Please press the back button in your browser twice.', 'event_espresso'));
58
+		}
59
+		$models_and_ids_to_delete = [];
60
+		foreach ($roots as $root) {
61
+			if (! $root instanceof ModelObjNode) {
62
+				throw new UnexpectedEntityException($root, 'ModelObjNode');
63
+			}
64
+			$models_and_ids_to_delete = array_replace_recursive($models_and_ids_to_delete, $root->getIds());
65
+		}
66
+		$job_parameters->set_extra_data(
67
+			[
68
+				'models_and_ids_to_delete' => $models_and_ids_to_delete
69
+			]
70
+		);
71
+		// Find the job's actual size.
72
+		$job_size = 0;
73
+		foreach ($models_and_ids_to_delete as $model_name => $ids) {
74
+			$job_size += count($ids);
75
+		}
76
+		$job_parameters->set_job_size($job_size);
77
+		return new JobStepResponse(
78
+			$job_parameters,
79
+			esc_html__('Beginning to delete items...', 'event_espresso')
80
+		);
81
+	}
82 82
 
83
-    /**
84
-     * Performs another step of the job
85
-     * @param JobParameters $job_parameters
86
-     * @param int $batch_size
87
-     * @return JobStepResponse
88
-     * @throws BatchRequestException
89
-     */
90
-    public function continue_job(JobParameters $job_parameters, $batch_size = 50)
91
-    {
92
-        // We already have the items IDs. So deleting is really fast. Let's speed it up.
93
-        $batch_size *= 10;
94
-        $units_processed = 0;
95
-        $models_and_ids_to_delete = $job_parameters->extra_datum('models_and_ids_to_delete', []);
96
-        // Build a new list of everything leftover after this request's of deletions.
97
-        $models_and_ids_remaining = [];
98
-        foreach ($models_and_ids_to_delete as $model_name => $ids_to_delete) {
99
-            if ($units_processed < $batch_size) {
100
-                $model = EE_Registry::instance()->load_model($model_name);
101
-                $ids_to_delete_this_query = array_slice($ids_to_delete, 0, $batch_size - $units_processed, true);
102
-                if ($model->has_primary_key_field()) {
103
-                    $where_conditions = [
104
-                        $model->primary_key_name() => [
105
-                            'IN',
106
-                            $ids_to_delete_this_query
107
-                        ]
108
-                    ];
109
-                } else {
110
-                    $where_conditions = [
111
-                        'OR' => []
112
-                    ];
113
-                    foreach ($ids_to_delete_this_query as $index_primary_key_string) {
114
-                        $keys_n_values = $model->parse_index_primary_key_string($index_primary_key_string);
115
-                        $where_conditions['OR'][ 'AND*' . $index_primary_key_string ] = $keys_n_values;
116
-                    }
117
-                }
118
-                // Deleting time!
119
-                // The model's deletion method reports every ROW deleted, and in the case of CPT models that will be
120
-                // two rows deleted for event CPT item. So don't rely on it for the count of items deleted.
121
-                $model->delete_permanently(
122
-                    [
123
-                        $where_conditions
124
-                    ],
125
-                    false
126
-                );
127
-                $units_processed += count($ids_to_delete_this_query);
128
-                $remaining_ids = array_diff_key($ids_to_delete, $ids_to_delete_this_query);
129
-                // If there's any more from this model, we'll do them next time.
130
-                if (count($remaining_ids) > 0) {
131
-                    $models_and_ids_remaining[ $model_name ] = $remaining_ids;
132
-                }
133
-            } else {
134
-                $models_and_ids_remaining[ $model_name ] = $models_and_ids_to_delete[ $model_name ];
135
-            }
136
-        }
137
-        $job_parameters->mark_processed($units_processed);
138
-        // All done deleting for this request. Is there anything to do next time?
139
-        if (empty($models_and_ids_remaining)) {
140
-            $job_parameters->set_status(JobParameters::status_complete);
141
-            return new JobStepResponse(
142
-                $job_parameters,
143
-                esc_html__('Deletion complete.', 'event_espresso')
144
-            );
145
-        }
146
-        $job_parameters->add_extra_data('models_and_ids_to_delete', $models_and_ids_remaining);
147
-        return new JobStepResponse(
148
-            $job_parameters,
149
-            sprintf(
150
-                esc_html__('Deleted %d items.', 'event_espresso'),
151
-                $units_processed
152
-            )
153
-        );
154
-    }
83
+	/**
84
+	 * Performs another step of the job
85
+	 * @param JobParameters $job_parameters
86
+	 * @param int $batch_size
87
+	 * @return JobStepResponse
88
+	 * @throws BatchRequestException
89
+	 */
90
+	public function continue_job(JobParameters $job_parameters, $batch_size = 50)
91
+	{
92
+		// We already have the items IDs. So deleting is really fast. Let's speed it up.
93
+		$batch_size *= 10;
94
+		$units_processed = 0;
95
+		$models_and_ids_to_delete = $job_parameters->extra_datum('models_and_ids_to_delete', []);
96
+		// Build a new list of everything leftover after this request's of deletions.
97
+		$models_and_ids_remaining = [];
98
+		foreach ($models_and_ids_to_delete as $model_name => $ids_to_delete) {
99
+			if ($units_processed < $batch_size) {
100
+				$model = EE_Registry::instance()->load_model($model_name);
101
+				$ids_to_delete_this_query = array_slice($ids_to_delete, 0, $batch_size - $units_processed, true);
102
+				if ($model->has_primary_key_field()) {
103
+					$where_conditions = [
104
+						$model->primary_key_name() => [
105
+							'IN',
106
+							$ids_to_delete_this_query
107
+						]
108
+					];
109
+				} else {
110
+					$where_conditions = [
111
+						'OR' => []
112
+					];
113
+					foreach ($ids_to_delete_this_query as $index_primary_key_string) {
114
+						$keys_n_values = $model->parse_index_primary_key_string($index_primary_key_string);
115
+						$where_conditions['OR'][ 'AND*' . $index_primary_key_string ] = $keys_n_values;
116
+					}
117
+				}
118
+				// Deleting time!
119
+				// The model's deletion method reports every ROW deleted, and in the case of CPT models that will be
120
+				// two rows deleted for event CPT item. So don't rely on it for the count of items deleted.
121
+				$model->delete_permanently(
122
+					[
123
+						$where_conditions
124
+					],
125
+					false
126
+				);
127
+				$units_processed += count($ids_to_delete_this_query);
128
+				$remaining_ids = array_diff_key($ids_to_delete, $ids_to_delete_this_query);
129
+				// If there's any more from this model, we'll do them next time.
130
+				if (count($remaining_ids) > 0) {
131
+					$models_and_ids_remaining[ $model_name ] = $remaining_ids;
132
+				}
133
+			} else {
134
+				$models_and_ids_remaining[ $model_name ] = $models_and_ids_to_delete[ $model_name ];
135
+			}
136
+		}
137
+		$job_parameters->mark_processed($units_processed);
138
+		// All done deleting for this request. Is there anything to do next time?
139
+		if (empty($models_and_ids_remaining)) {
140
+			$job_parameters->set_status(JobParameters::status_complete);
141
+			return new JobStepResponse(
142
+				$job_parameters,
143
+				esc_html__('Deletion complete.', 'event_espresso')
144
+			);
145
+		}
146
+		$job_parameters->add_extra_data('models_and_ids_to_delete', $models_and_ids_remaining);
147
+		return new JobStepResponse(
148
+			$job_parameters,
149
+			sprintf(
150
+				esc_html__('Deleted %d items.', 'event_espresso'),
151
+				$units_processed
152
+			)
153
+		);
154
+	}
155 155
 
156
-    /**
157
-     * Performs any clean-up logic when we know the job is completed
158
-     * @param JobParameters $job_parameters
159
-     * @return JobStepResponse
160
-     */
161
-    public function cleanup_job(JobParameters $job_parameters)
162
-    {
163
-        $this->model_obj_node_group_persister->deleteModelObjNodesInGroup(
164
-            $job_parameters->request_datum('deletion_job_code')
165
-        );
166
-        // For backwards compatibility with how we used to delete events, make sure we still trigger the old action.
167
-        $models_and_ids_to_delete = $job_parameters->extra_datum('models_and_ids_to_delete', []);
168
-        foreach ($models_and_ids_to_delete['Event'] as $event_id) {
169
-            // Create a log entry so we know who and when this event was permanently deleted.
170
-            (EE_Change_Log::new_instance(
171
-                [
172
-                    'OBJ_ID' => $event_id,
173
-                    'OBJ_type' => 'Event',
174
-                    'LOG_message' => sprintf(
175
-                        esc_html__('Event %1$d permanently deleted using ExecuteBatchDeletion.', 'event_espresso'),
176
-                        $event_id
177
-                    )
178
-                ]
179
-            ))->save();
180
-            do_action('AHEE__Events_Admin_Page___permanently_delete_event__after_event_deleted', $event_id);
181
-        }
182
-        return new JobStepResponse(
183
-            $job_parameters,
184
-            esc_html__('All done', 'event_espresso')
185
-        );
186
-    }
156
+	/**
157
+	 * Performs any clean-up logic when we know the job is completed
158
+	 * @param JobParameters $job_parameters
159
+	 * @return JobStepResponse
160
+	 */
161
+	public function cleanup_job(JobParameters $job_parameters)
162
+	{
163
+		$this->model_obj_node_group_persister->deleteModelObjNodesInGroup(
164
+			$job_parameters->request_datum('deletion_job_code')
165
+		);
166
+		// For backwards compatibility with how we used to delete events, make sure we still trigger the old action.
167
+		$models_and_ids_to_delete = $job_parameters->extra_datum('models_and_ids_to_delete', []);
168
+		foreach ($models_and_ids_to_delete['Event'] as $event_id) {
169
+			// Create a log entry so we know who and when this event was permanently deleted.
170
+			(EE_Change_Log::new_instance(
171
+				[
172
+					'OBJ_ID' => $event_id,
173
+					'OBJ_type' => 'Event',
174
+					'LOG_message' => sprintf(
175
+						esc_html__('Event %1$d permanently deleted using ExecuteBatchDeletion.', 'event_espresso'),
176
+						$event_id
177
+					)
178
+				]
179
+			))->save();
180
+			do_action('AHEE__Events_Admin_Page___permanently_delete_event__after_event_deleted', $event_id);
181
+		}
182
+		return new JobStepResponse(
183
+			$job_parameters,
184
+			esc_html__('All done', 'event_espresso')
185
+		);
186
+	}
187 187
 }
188 188
 // End of file EventDeletion.php
189 189
 // Location: EventEspressoBatchRequest\JobHandlers/EventDeletion.php
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
         }
59 59
         $models_and_ids_to_delete = [];
60 60
         foreach ($roots as $root) {
61
-            if (! $root instanceof ModelObjNode) {
61
+            if ( ! $root instanceof ModelObjNode) {
62 62
                 throw new UnexpectedEntityException($root, 'ModelObjNode');
63 63
             }
64 64
             $models_and_ids_to_delete = array_replace_recursive($models_and_ids_to_delete, $root->getIds());
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
                     ];
113 113
                     foreach ($ids_to_delete_this_query as $index_primary_key_string) {
114 114
                         $keys_n_values = $model->parse_index_primary_key_string($index_primary_key_string);
115
-                        $where_conditions['OR'][ 'AND*' . $index_primary_key_string ] = $keys_n_values;
115
+                        $where_conditions['OR']['AND*'.$index_primary_key_string] = $keys_n_values;
116 116
                     }
117 117
                 }
118 118
                 // Deleting time!
@@ -128,10 +128,10 @@  discard block
 block discarded – undo
128 128
                 $remaining_ids = array_diff_key($ids_to_delete, $ids_to_delete_this_query);
129 129
                 // If there's any more from this model, we'll do them next time.
130 130
                 if (count($remaining_ids) > 0) {
131
-                    $models_and_ids_remaining[ $model_name ] = $remaining_ids;
131
+                    $models_and_ids_remaining[$model_name] = $remaining_ids;
132 132
                 }
133 133
             } else {
134
-                $models_and_ids_remaining[ $model_name ] = $models_and_ids_to_delete[ $model_name ];
134
+                $models_and_ids_remaining[$model_name] = $models_and_ids_to_delete[$model_name];
135 135
             }
136 136
         }
137 137
         $job_parameters->mark_processed($units_processed);
Please login to merge, or discard this patch.
core/domain/services/admin/events/data/PreviewDeletion.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -89,17 +89,17 @@  discard block
 block discarded – undo
89 89
         $deletion_job_code = isset($request_data['deletion_job_code']) ? sanitize_key($request_data['deletion_job_code']) : '';
90 90
         $models_and_ids_to_delete = $this->dao->getModelsAndIdsFromGroup($deletion_job_code);
91 91
         $event_ids = isset($models_and_ids_to_delete['Event']) ? $models_and_ids_to_delete['Event'] : array();
92
-        if (empty($event_ids) || !is_array($event_ids)) {
92
+        if (empty($event_ids) || ! is_array($event_ids)) {
93 93
             throw new EE_Error(
94 94
                 esc_html__('No Events were found to delete.', 'event_espresso')
95 95
             );
96 96
         }
97 97
         $datetime_ids = isset($models_and_ids_to_delete['Datetime']) ? $models_and_ids_to_delete['Datetime'] : array();
98
-        if (!is_array($datetime_ids)) {
98
+        if ( ! is_array($datetime_ids)) {
99 99
             throw new UnexpectedEntityException($datetime_ids, 'array');
100 100
         }
101 101
         $registration_ids = isset($models_and_ids_to_delete['Registration']) ? $models_and_ids_to_delete['Registration'] : array();
102
-        if (!is_array($registration_ids)) {
102
+        if ( ! is_array($registration_ids)) {
103 103
             throw new UnexpectedEntityException($registration_ids, 'array');
104 104
         }
105 105
         $num_registrations_to_show = 10;
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
         ];
136 136
         return [
137 137
             'admin_page_content' => EEH_Template::display_template(
138
-                EVENTS_TEMPLATE_PATH . 'event_preview_deletion.template.php',
138
+                EVENTS_TEMPLATE_PATH.'event_preview_deletion.template.php',
139 139
                 [
140 140
                     'form_url' => EE_Admin_Page::add_query_args_and_nonce(
141 141
                         $confirm_deletion_args,
Please login to merge, or discard this patch.
Indentation   +116 added lines, -116 removed lines patch added patch discarded remove patch
@@ -31,127 +31,127 @@
 block discarded – undo
31 31
  */
32 32
 class PreviewDeletion
33 33
 {
34
-    /**
35
-     * @var NodeGroupDao
36
-     */
37
-    protected $dao;
34
+	/**
35
+	 * @var NodeGroupDao
36
+	 */
37
+	protected $dao;
38 38
 
39
-    /**
40
-     * @var EEM_Event
41
-     */
42
-    protected $event_model;
39
+	/**
40
+	 * @var EEM_Event
41
+	 */
42
+	protected $event_model;
43 43
 
44
-    /**
45
-     * @var EEM_Datetime
46
-     */
47
-    protected $datetime_model;
44
+	/**
45
+	 * @var EEM_Datetime
46
+	 */
47
+	protected $datetime_model;
48 48
 
49
-    /**
50
-     * @var EEM_Registration
51
-     */
52
-    protected $registration_model;
49
+	/**
50
+	 * @var EEM_Registration
51
+	 */
52
+	protected $registration_model;
53 53
 
54
-    /**
55
-     * PreviewDeletion constructor.
56
-     * @param NodeGroupDao $dao
57
-     * @param EEM_Event $event_model
58
-     * @param EEM_Datetime $datetime_model
59
-     * @param EEM_Registration $registration_model
60
-     */
61
-    public function __construct(
62
-        NodeGroupDao $dao,
63
-        EEM_Event $event_model,
64
-        EEM_Datetime $datetime_model,
65
-        EEM_Registration $registration_model
66
-    ) {
67
-        $this->dao = $dao;
68
-        $this->event_model = $event_model;
69
-        $this->datetime_model = $datetime_model;
70
-        $this->registration_model = $registration_model;
71
-    }
54
+	/**
55
+	 * PreviewDeletion constructor.
56
+	 * @param NodeGroupDao $dao
57
+	 * @param EEM_Event $event_model
58
+	 * @param EEM_Datetime $datetime_model
59
+	 * @param EEM_Registration $registration_model
60
+	 */
61
+	public function __construct(
62
+		NodeGroupDao $dao,
63
+		EEM_Event $event_model,
64
+		EEM_Datetime $datetime_model,
65
+		EEM_Registration $registration_model
66
+	) {
67
+		$this->dao = $dao;
68
+		$this->event_model = $event_model;
69
+		$this->datetime_model = $datetime_model;
70
+		$this->registration_model = $registration_model;
71
+	}
72 72
 
73
-    /**
74
-     * Renders the preview deletion page.
75
-     * @since 4.10.12.p
76
-     * @param $request_data
77
-     * @param $admin_base_url
78
-     * @return array
79
-     * @throws UnexpectedEntityException
80
-     * @throws DomainException
81
-     * @throws EE_Error
82
-     * @throws InvalidDataTypeException
83
-     * @throws InvalidInterfaceException
84
-     * @throws InvalidArgumentException
85
-     * @throws ReflectionException
86
-     */
87
-    public function handle($request_data, $admin_base_url)
88
-    {
89
-        $deletion_job_code = isset($request_data['deletion_job_code']) ? sanitize_key($request_data['deletion_job_code']) : '';
90
-        $models_and_ids_to_delete = $this->dao->getModelsAndIdsFromGroup($deletion_job_code);
91
-        $event_ids = isset($models_and_ids_to_delete['Event']) ? $models_and_ids_to_delete['Event'] : array();
92
-        if (empty($event_ids) || !is_array($event_ids)) {
93
-            throw new EE_Error(
94
-                esc_html__('No Events were found to delete.', 'event_espresso')
95
-            );
96
-        }
97
-        $datetime_ids = isset($models_and_ids_to_delete['Datetime']) ? $models_and_ids_to_delete['Datetime'] : array();
98
-        if (!is_array($datetime_ids)) {
99
-            throw new UnexpectedEntityException($datetime_ids, 'array');
100
-        }
101
-        $registration_ids = isset($models_and_ids_to_delete['Registration']) ? $models_and_ids_to_delete['Registration'] : array();
102
-        if (!is_array($registration_ids)) {
103
-            throw new UnexpectedEntityException($registration_ids, 'array');
104
-        }
105
-        $num_registrations_to_show = 10;
106
-        $reg_count = count($registration_ids);
107
-        if ($reg_count > $num_registrations_to_show) {
108
-            $registration_ids = array_slice($registration_ids, 0, $num_registrations_to_show);
109
-        }
110
-        $form = new ConfirmEventDeletionForm($event_ids);
111
-        $events = $this->event_model->get_all_deleted_and_undeleted(
112
-            [
113
-                [
114
-                    'EVT_ID' => ['IN', $event_ids]
115
-                ]
116
-            ]
117
-        );
118
-        $datetimes = $this->datetime_model->get_all_deleted_and_undeleted(
119
-            [
120
-                [
121
-                    'DTT_ID' => ['IN', $datetime_ids]
122
-                ]
123
-            ]
124
-        );
125
-        $registrations = $this->registration_model->get_all_deleted_and_undeleted(
126
-            [
127
-                [
128
-                    'REG_ID' => ['IN', $registration_ids]
129
-                ]
130
-            ]
131
-        );
132
-        $confirm_deletion_args = [
133
-            'action' => 'confirm_deletion',
134
-            'deletion_job_code' => $deletion_job_code
135
-        ];
136
-        return [
137
-            'admin_page_content' => EEH_Template::display_template(
138
-                EVENTS_TEMPLATE_PATH . 'event_preview_deletion.template.php',
139
-                [
140
-                    'form_url' => EE_Admin_Page::add_query_args_and_nonce(
141
-                        $confirm_deletion_args,
142
-                        $admin_base_url
143
-                    ),
144
-                    'form' => $form,
145
-                    'events' => $events,
146
-                    'datetimes' => $datetimes,
147
-                    'registrations' => $registrations,
148
-                    'reg_count' => $reg_count,
149
-                    'num_registrations_to_show' => $num_registrations_to_show
150
-                ],
151
-                true
152
-            )
153
-        ];
154
-    }
73
+	/**
74
+	 * Renders the preview deletion page.
75
+	 * @since 4.10.12.p
76
+	 * @param $request_data
77
+	 * @param $admin_base_url
78
+	 * @return array
79
+	 * @throws UnexpectedEntityException
80
+	 * @throws DomainException
81
+	 * @throws EE_Error
82
+	 * @throws InvalidDataTypeException
83
+	 * @throws InvalidInterfaceException
84
+	 * @throws InvalidArgumentException
85
+	 * @throws ReflectionException
86
+	 */
87
+	public function handle($request_data, $admin_base_url)
88
+	{
89
+		$deletion_job_code = isset($request_data['deletion_job_code']) ? sanitize_key($request_data['deletion_job_code']) : '';
90
+		$models_and_ids_to_delete = $this->dao->getModelsAndIdsFromGroup($deletion_job_code);
91
+		$event_ids = isset($models_and_ids_to_delete['Event']) ? $models_and_ids_to_delete['Event'] : array();
92
+		if (empty($event_ids) || !is_array($event_ids)) {
93
+			throw new EE_Error(
94
+				esc_html__('No Events were found to delete.', 'event_espresso')
95
+			);
96
+		}
97
+		$datetime_ids = isset($models_and_ids_to_delete['Datetime']) ? $models_and_ids_to_delete['Datetime'] : array();
98
+		if (!is_array($datetime_ids)) {
99
+			throw new UnexpectedEntityException($datetime_ids, 'array');
100
+		}
101
+		$registration_ids = isset($models_and_ids_to_delete['Registration']) ? $models_and_ids_to_delete['Registration'] : array();
102
+		if (!is_array($registration_ids)) {
103
+			throw new UnexpectedEntityException($registration_ids, 'array');
104
+		}
105
+		$num_registrations_to_show = 10;
106
+		$reg_count = count($registration_ids);
107
+		if ($reg_count > $num_registrations_to_show) {
108
+			$registration_ids = array_slice($registration_ids, 0, $num_registrations_to_show);
109
+		}
110
+		$form = new ConfirmEventDeletionForm($event_ids);
111
+		$events = $this->event_model->get_all_deleted_and_undeleted(
112
+			[
113
+				[
114
+					'EVT_ID' => ['IN', $event_ids]
115
+				]
116
+			]
117
+		);
118
+		$datetimes = $this->datetime_model->get_all_deleted_and_undeleted(
119
+			[
120
+				[
121
+					'DTT_ID' => ['IN', $datetime_ids]
122
+				]
123
+			]
124
+		);
125
+		$registrations = $this->registration_model->get_all_deleted_and_undeleted(
126
+			[
127
+				[
128
+					'REG_ID' => ['IN', $registration_ids]
129
+				]
130
+			]
131
+		);
132
+		$confirm_deletion_args = [
133
+			'action' => 'confirm_deletion',
134
+			'deletion_job_code' => $deletion_job_code
135
+		];
136
+		return [
137
+			'admin_page_content' => EEH_Template::display_template(
138
+				EVENTS_TEMPLATE_PATH . 'event_preview_deletion.template.php',
139
+				[
140
+					'form_url' => EE_Admin_Page::add_query_args_and_nonce(
141
+						$confirm_deletion_args,
142
+						$admin_base_url
143
+					),
144
+					'form' => $form,
145
+					'events' => $events,
146
+					'datetimes' => $datetimes,
147
+					'registrations' => $registrations,
148
+					'reg_count' => $reg_count,
149
+					'num_registrations_to_show' => $num_registrations_to_show
150
+				],
151
+				true
152
+			)
153
+		];
154
+	}
155 155
 }
156 156
 // End of file PreviewDeletion.php
157 157
 // Location: EventEspresso\core\domain\services\admin\events\data/PreviewDeletion.php
Please login to merge, or discard this patch.
core/domain/services/graphql/enums/TicketStatusEnum.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
      */
22 22
     public function __construct()
23 23
     {
24
-        $this->setName($this->namespace . 'TicketStatusEnum');
24
+        $this->setName($this->namespace.'TicketStatusEnum');
25 25
         $this->setDescription(esc_html__('Whether the ticket is On Sale, Pending, or Expired', 'event_espresso'));
26 26
         parent::__construct();
27 27
     }
Please login to merge, or discard this patch.
Indentation   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -16,38 +16,38 @@
 block discarded – undo
16 16
 class TicketStatusEnum extends EnumBase
17 17
 {
18 18
 
19
-    /**
20
-     * TicketStatusEnum constructor.
21
-     */
22
-    public function __construct()
23
-    {
24
-        $this->setName($this->namespace . 'TicketStatusEnum');
25
-        $this->setDescription(esc_html__('Whether the ticket is On Sale, Pending, or Expired', 'event_espresso'));
26
-        parent::__construct();
27
-    }
19
+	/**
20
+	 * TicketStatusEnum constructor.
21
+	 */
22
+	public function __construct()
23
+	{
24
+		$this->setName($this->namespace . 'TicketStatusEnum');
25
+		$this->setDescription(esc_html__('Whether the ticket is On Sale, Pending, or Expired', 'event_espresso'));
26
+		parent::__construct();
27
+	}
28 28
 
29 29
 
30
-    /**
31
-     * @return array
32
-     */
33
-    protected function getValues(): array
34
-    {
35
-        return [
36
-            'SOLD_OUT'     => [
37
-                'value'       => EE_Ticket::sold_out,
38
-            ],
39
-            'EXPIRED'     => [
40
-                'value'       => EE_Ticket::expired,
41
-            ],
42
-            'ARCHIVED'     => [
43
-                'value'       => EE_Ticket::archived,
44
-            ],
45
-            'PENDING'     => [
46
-                'value'       => EE_Ticket::pending,
47
-            ],
48
-            'ONSALE'     => [
49
-                'value'       => EE_Ticket::onsale,
50
-            ],
51
-        ];
52
-    }
30
+	/**
31
+	 * @return array
32
+	 */
33
+	protected function getValues(): array
34
+	{
35
+		return [
36
+			'SOLD_OUT'     => [
37
+				'value'       => EE_Ticket::sold_out,
38
+			],
39
+			'EXPIRED'     => [
40
+				'value'       => EE_Ticket::expired,
41
+			],
42
+			'ARCHIVED'     => [
43
+				'value'       => EE_Ticket::archived,
44
+			],
45
+			'PENDING'     => [
46
+				'value'       => EE_Ticket::pending,
47
+			],
48
+			'ONSALE'     => [
49
+				'value'       => EE_Ticket::onsale,
50
+			],
51
+		];
52
+	}
53 53
 }
Please login to merge, or discard this patch.
core/domain/services/graphql/enums/DatetimeStatusEnum.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
      */
22 22
     public function __construct()
23 23
     {
24
-        $this->setName($this->namespace . 'DatetimeStatusEnum');
24
+        $this->setName($this->namespace.'DatetimeStatusEnum');
25 25
         $this->setDescription(esc_html__('Datetime status', 'event_espresso'));
26 26
         parent::__construct();
27 27
     }
Please login to merge, or discard this patch.
Indentation   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -16,44 +16,44 @@
 block discarded – undo
16 16
 class DatetimeStatusEnum extends EnumBase
17 17
 {
18 18
 
19
-    /**
20
-     * DatetimeStatusEnum constructor.
21
-     */
22
-    public function __construct()
23
-    {
24
-        $this->setName($this->namespace . 'DatetimeStatusEnum');
25
-        $this->setDescription(esc_html__('Datetime status', 'event_espresso'));
26
-        parent::__construct();
27
-    }
19
+	/**
20
+	 * DatetimeStatusEnum constructor.
21
+	 */
22
+	public function __construct()
23
+	{
24
+		$this->setName($this->namespace . 'DatetimeStatusEnum');
25
+		$this->setDescription(esc_html__('Datetime status', 'event_espresso'));
26
+		parent::__construct();
27
+	}
28 28
 
29 29
 
30
-    /**
31
-     * @return array
32
-     */
33
-    protected function getValues(): array
34
-    {
35
-        return [
36
-            'SOLD_OUT'     => [
37
-                'value'       => EE_Datetime::sold_out,
38
-            ],
39
-            'ACTIVE'     => [
40
-                'value'       => EE_Datetime::active,
41
-            ],
42
-            'UPCOMING'     => [
43
-                'value'       => EE_Datetime::upcoming,
44
-            ],
45
-            'POSTPONED'     => [
46
-                'value'       => EE_Datetime::postponed,
47
-            ],
48
-            'CANCELLED'     => [
49
-                'value'       => EE_Datetime::cancelled,
50
-            ],
51
-            'EXPIRED'     => [
52
-                'value'       => EE_Datetime::expired,
53
-            ],
54
-            'INACTIVE'     => [
55
-                'value'       => EE_Datetime::inactive,
56
-            ],
57
-        ];
58
-    }
30
+	/**
31
+	 * @return array
32
+	 */
33
+	protected function getValues(): array
34
+	{
35
+		return [
36
+			'SOLD_OUT'     => [
37
+				'value'       => EE_Datetime::sold_out,
38
+			],
39
+			'ACTIVE'     => [
40
+				'value'       => EE_Datetime::active,
41
+			],
42
+			'UPCOMING'     => [
43
+				'value'       => EE_Datetime::upcoming,
44
+			],
45
+			'POSTPONED'     => [
46
+				'value'       => EE_Datetime::postponed,
47
+			],
48
+			'CANCELLED'     => [
49
+				'value'       => EE_Datetime::cancelled,
50
+			],
51
+			'EXPIRED'     => [
52
+				'value'       => EE_Datetime::expired,
53
+			],
54
+			'INACTIVE'     => [
55
+				'value'       => EE_Datetime::inactive,
56
+			],
57
+		];
58
+	}
59 59
 }
Please login to merge, or discard this patch.
admin_pages/events/form_sections/ConfirmEventDeletionForm.php 2 patches
Indentation   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -22,55 +22,55 @@
 block discarded – undo
22 22
  */
23 23
 class ConfirmEventDeletionForm extends \EE_Form_Section_Proper
24 24
 {
25
-    /**
26
-     * @var EE_Event[]
27
-     */
28
-    protected $events;
29
-    public function __construct($event_ids, $options_array = array())
30
-    {
31
-        if (! isset($options_array['subsections'])) {
32
-            $options_array['subsections'] = [];
33
-        }
34
-        if (! isset($options_array['subsections']['events'])) {
35
-            $events_subsection = new \EE_Form_Section_Proper();
36
-            $options_array['subsections']['events'] = $events_subsection;
37
-        }
38
-        $events = EEM_Event::instance()->get_all_deleted_and_undeleted(
39
-            [
40
-                [
41
-                    'EVT_ID' => ['IN',$event_ids]
42
-                ]
43
-            ]
44
-        );
45
-        if (! is_array($events)) {
46
-            throw new UnexpectedEntityException($event_ids, 'array');
47
-        }
48
-        $this->events = $events;
49
-        $events_inputs = [
50
-        ];
51
-        foreach ($events as $event) {
52
-            $events_inputs[ $event->ID() ] = new EE_Checkbox_Multi_Input(
53
-                [
54
-                    'yes' => $event->name(),
55
-                ],
56
-                [
57
-                    'html_label_text' => esc_html__('Please confirm you wish to delete:', 'event_espresso'),
58
-                    'required' => true
59
-                ]
60
-            );
61
-        }
62
-        $events_subsection->add_subsections($events_inputs);
63
-        $options_array['subsections']['backup'] = new EE_Checkbox_Multi_Input(
64
-            [
65
-                'yes' => esc_html__('I have backed up my database.', 'event_espresso')
66
-            ],
67
-            [
68
-                'html_label_text' => esc_html__('Deleting this data cannot be undone. Please confirm you have a usable database backup.', 'event_espresso'),
69
-                'required' => true
70
-            ]
71
-        );
72
-        parent::__construct($options_array);
73
-    }
25
+	/**
26
+	 * @var EE_Event[]
27
+	 */
28
+	protected $events;
29
+	public function __construct($event_ids, $options_array = array())
30
+	{
31
+		if (! isset($options_array['subsections'])) {
32
+			$options_array['subsections'] = [];
33
+		}
34
+		if (! isset($options_array['subsections']['events'])) {
35
+			$events_subsection = new \EE_Form_Section_Proper();
36
+			$options_array['subsections']['events'] = $events_subsection;
37
+		}
38
+		$events = EEM_Event::instance()->get_all_deleted_and_undeleted(
39
+			[
40
+				[
41
+					'EVT_ID' => ['IN',$event_ids]
42
+				]
43
+			]
44
+		);
45
+		if (! is_array($events)) {
46
+			throw new UnexpectedEntityException($event_ids, 'array');
47
+		}
48
+		$this->events = $events;
49
+		$events_inputs = [
50
+		];
51
+		foreach ($events as $event) {
52
+			$events_inputs[ $event->ID() ] = new EE_Checkbox_Multi_Input(
53
+				[
54
+					'yes' => $event->name(),
55
+				],
56
+				[
57
+					'html_label_text' => esc_html__('Please confirm you wish to delete:', 'event_espresso'),
58
+					'required' => true
59
+				]
60
+			);
61
+		}
62
+		$events_subsection->add_subsections($events_inputs);
63
+		$options_array['subsections']['backup'] = new EE_Checkbox_Multi_Input(
64
+			[
65
+				'yes' => esc_html__('I have backed up my database.', 'event_espresso')
66
+			],
67
+			[
68
+				'html_label_text' => esc_html__('Deleting this data cannot be undone. Please confirm you have a usable database backup.', 'event_espresso'),
69
+				'required' => true
70
+			]
71
+		);
72
+		parent::__construct($options_array);
73
+	}
74 74
 }
75 75
 // End of file ConfirmEventDeletionForm.php
76 76
 // Location: EventEspresso\admin_pages\events\form_sections/ConfirmEventDeletionForm.php
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -28,28 +28,28 @@
 block discarded – undo
28 28
     protected $events;
29 29
     public function __construct($event_ids, $options_array = array())
30 30
     {
31
-        if (! isset($options_array['subsections'])) {
31
+        if ( ! isset($options_array['subsections'])) {
32 32
             $options_array['subsections'] = [];
33 33
         }
34
-        if (! isset($options_array['subsections']['events'])) {
34
+        if ( ! isset($options_array['subsections']['events'])) {
35 35
             $events_subsection = new \EE_Form_Section_Proper();
36 36
             $options_array['subsections']['events'] = $events_subsection;
37 37
         }
38 38
         $events = EEM_Event::instance()->get_all_deleted_and_undeleted(
39 39
             [
40 40
                 [
41
-                    'EVT_ID' => ['IN',$event_ids]
41
+                    'EVT_ID' => ['IN', $event_ids]
42 42
                 ]
43 43
             ]
44 44
         );
45
-        if (! is_array($events)) {
45
+        if ( ! is_array($events)) {
46 46
             throw new UnexpectedEntityException($event_ids, 'array');
47 47
         }
48 48
         $this->events = $events;
49 49
         $events_inputs = [
50 50
         ];
51 51
         foreach ($events as $event) {
52
-            $events_inputs[ $event->ID() ] = new EE_Checkbox_Multi_Input(
52
+            $events_inputs[$event->ID()] = new EE_Checkbox_Multi_Input(
53 53
                 [
54 54
                     'yes' => $event->name(),
55 55
                 ],
Please login to merge, or discard this patch.