PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.3.4
JetFormBuilder — Dynamic Blocks Form Builder v3.3.4
3.6.3.1 3.6.3 3.6.2.2 3.6.2.1 3.6.2 3.6.1.1 3.6.1 3.6.0.1 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.1.0 2.1.1 2.1.10 2.1.11 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 3.0.0 3.0.0.1 3.0.0.2 3.0.0.3 3.0.1 3.0.1.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.0.1 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.2 3.2.3 3.3.0 3.3.1 3.3.2 3.3.3 3.3.3.1 3.3.4 3.3.4.1 3.3.4.2 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.5.1 3.4.5.2 3.4.6 3.4.7 3.4.7.1 3.5.0 3.5.1 3.5.1.1 3.5.1.2 3.5.2 3.5.2.1 3.5.3 3.5.4 3.5.5 3.5.6 3.5.6.1 3.5.6.2 3.5.6.3 3.6.0
jetformbuilder / modules / gateways / export / single-controller.php
jetformbuilder / modules / gateways / export Last commit date
base-export-controller.php 2 years ago multiple-controller.php 2 years ago single-controller.php 2 years ago
single-controller.php
64 lines
1 <?php
2
3
4 namespace JFB_Modules\Gateways\Export;
5
6 use JFB_Modules\Gateways\Query_Views\Payment_For_Export_View;
7
8 // If this file is called directly, abort.
9 if ( ! defined( 'WPINC' ) ) {
10 die;
11 }
12
13
14 class Single_Controller extends Base_Export_Controller {
15
16 /**
17 * @throws \Exception
18 */
19 public function do_export() {
20 $payment_id = $this->get_payment_id();
21 $payment_view = Payment_For_Export_View::find( array( 'id' => $payment_id ) );
22 $payment_view->set_select( array_keys( $this->columns ) );
23
24 $payment = $payment_view->set_limit( array( 1 ) )->query()->query_one();
25
26 $this->get_exporter()->set_title(
27 /* translators: %d - record ID */
28 sprintf( __( 'JFB Payment %d', 'jet-form-builder' ), $payment_id )
29 );
30 $this->get_exporter()->open();
31
32 // headings
33 $this->get_exporter()->add_row(
34 $this->prepare_row(
35 $this->columns,
36 $this->record_columns,
37 $this->payers_columns,
38 $this->shipping_columns
39 )
40 );
41
42 $this->add_row( $payment );
43 $this->get_exporter()->close();
44 die;
45 }
46
47 /**
48 * @return int
49 * @throws \Exception
50 */
51 protected function get_payment_id(): int {
52 // phpcs:ignore WordPress.Security.NonceVerification.Recommended
53 $payment_id = absint( $_GET['id'] ?? '' );
54
55 if ( ! $payment_id ) {
56 throw new \Exception(
57 esc_html__( 'Payment ID is empty', 'jet-form-builder' )
58 );
59 }
60
61 return $payment_id;
62 }
63 }
64