@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | * @subpackage |
9 | 9 | * @author Mike Nelson |
10 | 10 | */ |
11 | -class EE_Select_Multi_Model_Input extends EE_Select_Multiple_Input{ |
|
11 | +class EE_Select_Multi_Model_Input extends EE_Select_Multiple_Input { |
|
12 | 12 | |
13 | 13 | |
14 | 14 | protected $_naming_method; |
@@ -24,18 +24,18 @@ discard block |
||
24 | 24 | * example: if the class were an EE_Event, this could be slug(), description(), name() (default) |
25 | 25 | * } |
26 | 26 | */ |
27 | - public function __construct( $answer_options = array(), $input_settings = array() ) { |
|
28 | - if( isset( $input_settings['naming_method'] )){ |
|
29 | - $this->set_option_naming_method( $input_settings['naming_method'] ); |
|
27 | + public function __construct($answer_options = array(), $input_settings = array()) { |
|
28 | + if (isset($input_settings['naming_method'])) { |
|
29 | + $this->set_option_naming_method($input_settings['naming_method']); |
|
30 | 30 | } |
31 | - parent::__construct( $answer_options, $input_settings ); |
|
31 | + parent::__construct($answer_options, $input_settings); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | /** |
35 | 35 | * Sets the method name which will be called when outputting the options list |
36 | 36 | * @param string $method |
37 | 37 | */ |
38 | - public function set_option_naming_method($method){ |
|
38 | + public function set_option_naming_method($method) { |
|
39 | 39 | $this->_naming_method = $method; |
40 | 40 | } |
41 | 41 | |
@@ -46,16 +46,16 @@ discard block |
||
46 | 46 | * @param EE_Base_Class[] $answer_options |
47 | 47 | * @return null|void |
48 | 48 | */ |
49 | - public function set_select_options( $answer_options = array() ) { |
|
49 | + public function set_select_options($answer_options = array()) { |
|
50 | 50 | //convert the model objects to select from into normal select options |
51 | 51 | $select_options = array(); |
52 | - foreach( $answer_options as $model_obj ){ |
|
53 | - if( $this->_naming_method ){ |
|
54 | - $display_value = call_user_func( array( $model_obj, $this->_naming_method )); |
|
55 | - }else{ |
|
52 | + foreach ($answer_options as $model_obj) { |
|
53 | + if ($this->_naming_method) { |
|
54 | + $display_value = call_user_func(array($model_obj, $this->_naming_method)); |
|
55 | + } else { |
|
56 | 56 | $display_value = $model_obj->name(); |
57 | 57 | } |
58 | - $select_options[ $model_obj->ID() ] = $display_value; |
|
58 | + $select_options[$model_obj->ID()] = $display_value; |
|
59 | 59 | } |
60 | 60 | parent::set_select_options($select_options); |
61 | 61 | } |
@@ -67,12 +67,12 @@ discard block |
||
67 | 67 | * into the format EE_Select_Multiple expects |
68 | 68 | * @param EE_Base_Class[]|array $values |
69 | 69 | */ |
70 | - public function set_default($values){ |
|
70 | + public function set_default($values) { |
|
71 | 71 | $defaults_as_simple_ids = array(); |
72 | - foreach($values as $key => $value){ |
|
73 | - if($value instanceof EE_Base_Class){ |
|
72 | + foreach ($values as $key => $value) { |
|
73 | + if ($value instanceof EE_Base_Class) { |
|
74 | 74 | $defaults_as_simple_ids[] = $value->ID(); |
75 | - }else{ |
|
75 | + } else { |
|
76 | 76 | $defaults_as_simple_ids[] = $value; |
77 | 77 | } |
78 | 78 | } |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | foreach( $answer_options as $model_obj ){ |
53 | 53 | if( $this->_naming_method ){ |
54 | 54 | $display_value = call_user_func( array( $model_obj, $this->_naming_method )); |
55 | - }else{ |
|
55 | + } else{ |
|
56 | 56 | $display_value = $model_obj->name(); |
57 | 57 | } |
58 | 58 | $select_options[ $model_obj->ID() ] = $display_value; |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | foreach($values as $key => $value){ |
73 | 73 | if($value instanceof EE_Base_Class){ |
74 | 74 | $defaults_as_simple_ids[] = $value->ID(); |
75 | - }else{ |
|
75 | + } else{ |
|
76 | 76 | $defaults_as_simple_ids[] = $value; |
77 | 77 | } |
78 | 78 | } |
@@ -6,17 +6,17 @@ |
||
6 | 6 | * @subpackage |
7 | 7 | * @author Mike Nelson |
8 | 8 | */ |
9 | -class EE_Select_Multiple_Input extends EE_Form_Input_With_Options_Base{ |
|
9 | +class EE_Select_Multiple_Input extends EE_Form_Input_With_Options_Base { |
|
10 | 10 | |
11 | 11 | /** |
12 | 12 | * @param array | EE_Question_Option[] $answer_options |
13 | 13 | * @param array $input_settings |
14 | 14 | */ |
15 | - public function __construct( $answer_options, $input_settings = array() ) { |
|
16 | - $this->_set_display_strategy( new EE_Select_Multiple_Display_Strategy() ); |
|
17 | - $this->_add_validation_strategy( new EE_Many_Valued_Validation_Strategy( array( new EE_Enum_Validation_Strategy( isset( $input_settings[ 'validation_error_message' ] ) ? $input_settings[ 'validation_error_message' ] : NULL ) ))); |
|
15 | + public function __construct($answer_options, $input_settings = array()) { |
|
16 | + $this->_set_display_strategy(new EE_Select_Multiple_Display_Strategy()); |
|
17 | + $this->_add_validation_strategy(new EE_Many_Valued_Validation_Strategy(array(new EE_Enum_Validation_Strategy(isset($input_settings['validation_error_message']) ? $input_settings['validation_error_message'] : NULL)))); |
|
18 | 18 | $this->_multiple_selections = TRUE; |
19 | - parent::__construct( $answer_options, $input_settings ); |
|
19 | + parent::__construct($answer_options, $input_settings); |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | } |
@@ -6,19 +6,19 @@ discard block |
||
6 | 6 | * @subpackage |
7 | 7 | * @author Mike Nelson |
8 | 8 | */ |
9 | -class EE_State_Select_Input extends EE_Select_Input{ |
|
9 | +class EE_State_Select_Input extends EE_Select_Input { |
|
10 | 10 | |
11 | 11 | /** |
12 | 12 | * @param array $state_options |
13 | 13 | * @param array $input_settings |
14 | 14 | */ |
15 | - function __construct( $state_options, $input_settings = array() ){ |
|
15 | + function __construct($state_options, $input_settings = array()) { |
|
16 | 16 | $state_options = apply_filters( |
17 | 17 | 'FHEE__EE_State_Select_Input____construct__state_options', |
18 | - $this->get_state_answer_options( $state_options ), |
|
18 | + $this->get_state_answer_options($state_options), |
|
19 | 19 | $this |
20 | 20 | ); |
21 | - parent::__construct( $state_options, $input_settings ); |
|
21 | + parent::__construct($state_options, $input_settings); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | |
@@ -29,17 +29,17 @@ discard block |
||
29 | 29 | * @param array $state_options |
30 | 30 | * @return array |
31 | 31 | */ |
32 | - public function get_state_answer_options( $state_options = NULL ){ |
|
32 | + public function get_state_answer_options($state_options = NULL) { |
|
33 | 33 | // if passed something that is NOT an array |
34 | - if ( ! is_array( $state_options )) { |
|
34 | + if ( ! is_array($state_options)) { |
|
35 | 35 | // get possibly cached list of states |
36 | 36 | $states = EEM_State::instance()->get_all_active_states(); |
37 | - if ( ! empty( $states )) { |
|
37 | + if ( ! empty($states)) { |
|
38 | 38 | //set the default |
39 | 39 | $state_options[''][''] = ''; |
40 | - foreach( $states as $state ){ |
|
41 | - if ( $state instanceof EE_State ) { |
|
42 | - $state_options[ $state->country()->name() ][ $state->ID() ] = $state->name(); |
|
40 | + foreach ($states as $state) { |
|
41 | + if ($state instanceof EE_State) { |
|
42 | + $state_options[$state->country()->name()][$state->ID()] = $state->name(); |
|
43 | 43 | } |
44 | 44 | } |
45 | 45 | } else { |
@@ -8,15 +8,15 @@ |
||
8 | 8 | * |
9 | 9 | * This input has a default validation strategy of plaintext (which can be removed after construction) |
10 | 10 | */ |
11 | -class EE_Submit_Input extends EE_Form_Input_Base{ |
|
11 | +class EE_Submit_Input extends EE_Form_Input_Base { |
|
12 | 12 | |
13 | 13 | /** |
14 | 14 | * @param array $options |
15 | 15 | */ |
16 | - function __construct($options = array()){ |
|
16 | + function __construct($options = array()) { |
|
17 | 17 | $this->_set_display_strategy(new EE_Submit_Input_Display_Strategy()); |
18 | 18 | $this->_set_normalization_strategy(new EE_Text_Normalization()); |
19 | - $this->_add_validation_strategy( new EE_Plaintext_Validation_Strategy() ); |
|
19 | + $this->_add_validation_strategy(new EE_Plaintext_Validation_Strategy()); |
|
20 | 20 | parent::__construct($options); |
21 | 21 | } |
22 | 22 | } |
23 | 23 | \ No newline at end of file |
@@ -1,13 +1,13 @@ |
||
1 | 1 | <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); } |
2 | 2 | /** |
3 | - * EE_Text_Area |
|
4 | - * |
|
5 | - * @package Event Espresso |
|
6 | - * @subpackage |
|
7 | - * @author Mike Nelson |
|
8 | - * |
|
9 | - * This input has a default validation strategy of plaintext (which can be removed after construction) |
|
10 | - */ |
|
3 | + * EE_Text_Area |
|
4 | + * |
|
5 | + * @package Event Espresso |
|
6 | + * @subpackage |
|
7 | + * @author Mike Nelson |
|
8 | + * |
|
9 | + * This input has a default validation strategy of plaintext (which can be removed after construction) |
|
10 | + */ |
|
11 | 11 | class EE_Text_Area_Input extends EE_Form_Input_Base{ |
12 | 12 | |
13 | 13 |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | * |
9 | 9 | * This input has a default validation strategy of plaintext (which can be removed after construction) |
10 | 10 | */ |
11 | -class EE_Text_Area_Input extends EE_Form_Input_Base{ |
|
11 | +class EE_Text_Area_Input extends EE_Form_Input_Base { |
|
12 | 12 | |
13 | 13 | |
14 | 14 | protected $_rows = 2; |
@@ -18,28 +18,28 @@ discard block |
||
18 | 18 | * sets the rows property on this input |
19 | 19 | * @param int $rows |
20 | 20 | */ |
21 | - public function set_rows( $rows ) { |
|
21 | + public function set_rows($rows) { |
|
22 | 22 | $this->_rows = $rows; |
23 | 23 | } |
24 | 24 | /** |
25 | 25 | * sets the cols html property on this input |
26 | 26 | * @param int $cols |
27 | 27 | */ |
28 | - public function set_cols( $cols ) { |
|
28 | + public function set_cols($cols) { |
|
29 | 29 | $this->_cols = $cols; |
30 | 30 | } |
31 | 31 | /** |
32 | 32 | * |
33 | 33 | * @return int |
34 | 34 | */ |
35 | - public function get_rows(){ |
|
35 | + public function get_rows() { |
|
36 | 36 | return $this->_rows; |
37 | 37 | } |
38 | 38 | /** |
39 | 39 | * |
40 | 40 | * @return int |
41 | 41 | */ |
42 | - public function get_cols(){ |
|
42 | + public function get_cols() { |
|
43 | 43 | return $this->_cols; |
44 | 44 | } |
45 | 45 | |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | $this->_set_normalization_strategy(new EE_Text_Normalization()); |
54 | 54 | //by default we use the plaintext validation. If you want something else, |
55 | 55 | //just remove it after the input is constructed :P using EE_Form_Input_Base::remove_validation_strategy() |
56 | - $this->_add_validation_strategy( new EE_Plaintext_Validation_Strategy() ); |
|
56 | + $this->_add_validation_strategy(new EE_Plaintext_Validation_Strategy()); |
|
57 | 57 | parent::__construct($options_array); |
58 | 58 | } |
59 | 59 | } |
@@ -8,18 +8,18 @@ |
||
8 | 8 | * |
9 | 9 | * This input has a default validation strategy of plaintext (which can be removed after construction) |
10 | 10 | */ |
11 | -class EE_Text_Input extends EE_Form_Input_Base{ |
|
11 | +class EE_Text_Input extends EE_Form_Input_Base { |
|
12 | 12 | |
13 | 13 | |
14 | 14 | /** |
15 | 15 | * @param array $options |
16 | 16 | */ |
17 | - function __construct($options = array()){ |
|
17 | + function __construct($options = array()) { |
|
18 | 18 | $this->_set_display_strategy(new EE_Text_Input_Display_Strategy()); |
19 | 19 | $this->_set_normalization_strategy(new EE_Text_Normalization()); |
20 | 20 | //by default we use the plaintext validation. If you want something else, |
21 | 21 | //just remove it after the input is constructed :P using EE_Form_Input_Base::remove_validation_strategy() |
22 | - $this->_add_validation_strategy( new EE_Plaintext_Validation_Strategy() ); |
|
22 | + $this->_add_validation_strategy(new EE_Plaintext_Validation_Strategy()); |
|
23 | 23 | parent::__construct($options); |
24 | 24 | } |
25 | 25 |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if (!defined('EVENT_ESPRESSO_VERSION')) |
|
2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
3 | 3 | exit('No direct script access allowed'); |
4 | 4 | |
5 | 5 | /** |
@@ -24,18 +24,18 @@ discard block |
||
24 | 24 | * |
25 | 25 | * ------------------------------------------------------------------------ |
26 | 26 | */ |
27 | -class EE_Year_Input extends EE_Select_Input{ |
|
27 | +class EE_Year_Input extends EE_Select_Input { |
|
28 | 28 | |
29 | - function __construct( $input_settings = array(), $four_digit_year = true, $years_behind = 1, $years_ahead = 15 ){ |
|
30 | - if($four_digit_year){ |
|
29 | + function __construct($input_settings = array(), $four_digit_year = true, $years_behind = 1, $years_ahead = 15) { |
|
30 | + if ($four_digit_year) { |
|
31 | 31 | $current_year_int = intval(date('Y')); |
32 | - }else{ |
|
32 | + } else { |
|
33 | 33 | $current_year_int = intval(date('y')); |
34 | 34 | } |
35 | 35 | $answer_options = array(); |
36 | - for( $start = $current_year_int - $years_behind; $start <= ($current_year_int + $years_ahead); $start++){ |
|
36 | + for ($start = $current_year_int - $years_behind; $start <= ($current_year_int + $years_ahead); $start++) { |
|
37 | 37 | $answer_options[$start] = $start; |
38 | 38 | } |
39 | - parent::__construct( $answer_options, $input_settings ); |
|
39 | + parent::__construct($answer_options, $input_settings); |
|
40 | 40 | } |
41 | 41 | } |
@@ -1,7 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (!defined('EVENT_ESPRESSO_VERSION')) |
|
3 | +if (!defined('EVENT_ESPRESSO_VERSION')) { |
|
4 | 4 | exit('No direct script access allowed'); |
5 | +} |
|
5 | 6 | |
6 | 7 | /** |
7 | 8 | * Event Espresso |
@@ -53,7 +54,7 @@ discard block |
||
53 | 54 | EEH_HTML::indent( 1, 'select' ); |
54 | 55 | if( EEH_Array::is_multi_dimensional_array( $this->_input->options() )){ |
55 | 56 | throw new EE_Error(sprintf(__("Select multiple display strategy does not allow for nested arrays of options.", "event_espresso"))); |
56 | - }else{ |
|
57 | + } else{ |
|
57 | 58 | $html.=$this->_display_options( $this->_input->options() ); |
58 | 59 | } |
59 | 60 |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); } |
2 | 2 | /** |
3 | - * EE_Yes_No_Input |
|
4 | - * |
|
5 | - * @package Event Espresso |
|
6 | - * @subpackage |
|
7 | - * @author Mike Nelson |
|
8 | - */ |
|
3 | + * EE_Yes_No_Input |
|
4 | + * |
|
5 | + * @package Event Espresso |
|
6 | + * @subpackage |
|
7 | + * @author Mike Nelson |
|
8 | + */ |
|
9 | 9 | class EE_Yes_No_Input extends EE_Select_Input{ |
10 | 10 | |
11 | 11 | /** |
@@ -6,14 +6,14 @@ |
||
6 | 6 | * @subpackage |
7 | 7 | * @author Mike Nelson |
8 | 8 | */ |
9 | -class EE_Yes_No_Input extends EE_Select_Input{ |
|
9 | +class EE_Yes_No_Input extends EE_Select_Input { |
|
10 | 10 | |
11 | 11 | /** |
12 | 12 | * @param array $options |
13 | 13 | */ |
14 | - function __construct( $options = array()){ |
|
15 | - $select_options = array(true=> __("Yes", "event_espresso"),false=> __("No", "event_espresso")); |
|
14 | + function __construct($options = array()) { |
|
15 | + $select_options = array(true=> __("Yes", "event_espresso"), false=> __("No", "event_espresso")); |
|
16 | 16 | |
17 | - parent::__construct($select_options,$options); |
|
17 | + parent::__construct($select_options, $options); |
|
18 | 18 | } |
19 | 19 | } |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
3 | - exit( 'No direct script access allowed' ); |
|
2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
3 | + exit('No direct script access allowed'); |
|
4 | 4 | } |
5 | 5 | |
6 | 6 | /** |
@@ -14,31 +14,31 @@ discard block |
||
14 | 14 | * @author Mike Nelson |
15 | 15 | * |
16 | 16 | */ |
17 | -class EE_Billing_Attendee_Info_Form extends EE_Billing_Info_Form{ |
|
17 | +class EE_Billing_Attendee_Info_Form extends EE_Billing_Info_Form { |
|
18 | 18 | |
19 | 19 | /** |
20 | 20 | * |
21 | 21 | * @param EE_Payment_Method $payment_method |
22 | 22 | * @param array $options_array @see EE_Form_Section_Proper::__construct() |
23 | 23 | */ |
24 | - public function __construct( EE_Payment_Method $payment_method, $options_array= array()){ |
|
24 | + public function __construct(EE_Payment_Method $payment_method, $options_array = array()) { |
|
25 | 25 | $options_array['subsections'] = array_merge( |
26 | 26 | array( |
27 | - 'first_name' => new EE_Text_Input( array( 'required'=>TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-fname', 'html_label_text' => __( 'First Name', 'event_espresso' ) ) ), |
|
28 | - 'last_name' => new EE_Text_Input( array( 'required'=>TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-lname', 'html_label_text' => __( 'Last Name', 'event_espresso' ) ) ), |
|
29 | - 'email' => new EE_Email_Input( array( 'required'=>TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-email', 'html_label_text' => __( 'Email', 'event_espresso' ) ) ), |
|
30 | - 'address' => new EE_Text_Input( array( 'html_label_text'=> __( 'Address', 'event_espresso'), 'required'=>TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-address' )), |
|
31 | - 'address2' => new EE_Text_Input( array( 'html_label_text'=> __( 'Address 2', 'event_espresso'), 'html_class' => 'ee-billing-qstn ee-billing-qstn-address2' )), |
|
32 | - 'city' => new EE_Text_Input( array( 'required'=>TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-city', 'html_label_text' => __( 'City', 'event_espresso' ) ) ), |
|
33 | - 'state' => apply_filters( 'FHEE__EE_Billing_Attendee_Info_Form__state_field', new EE_State_Select_Input( NULL, array( 'required'=>TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-state', 'html_label_text' => __( 'State', 'event_espresso' ) ) ) ), |
|
34 | - 'country' => apply_filters( 'FHEE__EE_Billing_Attendee_Info_Form__country_field', new EE_Country_Select_Input( NULL, array( 'required'=>TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-country', 'html_label_text' => __( 'Country', 'event_espresso' ) ) ) ), |
|
35 | - 'zip' => new EE_Text_Input( array( 'required'=>TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-zip', 'html_label_text' => __( 'Zip', 'event_espresso' ) ) ), |
|
36 | - 'phone' => new EE_Text_Input( array( 'html_class' => 'ee-billing-qstn ee-billing-qstn-phone', 'html_label_text' => __( 'Phone', 'event_espresso' ) )), |
|
27 | + 'first_name' => new EE_Text_Input(array('required'=>TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-fname', 'html_label_text' => __('First Name', 'event_espresso'))), |
|
28 | + 'last_name' => new EE_Text_Input(array('required'=>TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-lname', 'html_label_text' => __('Last Name', 'event_espresso'))), |
|
29 | + 'email' => new EE_Email_Input(array('required'=>TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-email', 'html_label_text' => __('Email', 'event_espresso'))), |
|
30 | + 'address' => new EE_Text_Input(array('html_label_text'=> __('Address', 'event_espresso'), 'required'=>TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-address')), |
|
31 | + 'address2' => new EE_Text_Input(array('html_label_text'=> __('Address 2', 'event_espresso'), 'html_class' => 'ee-billing-qstn ee-billing-qstn-address2')), |
|
32 | + 'city' => new EE_Text_Input(array('required'=>TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-city', 'html_label_text' => __('City', 'event_espresso'))), |
|
33 | + 'state' => apply_filters('FHEE__EE_Billing_Attendee_Info_Form__state_field', new EE_State_Select_Input(NULL, array('required'=>TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-state', 'html_label_text' => __('State', 'event_espresso')))), |
|
34 | + 'country' => apply_filters('FHEE__EE_Billing_Attendee_Info_Form__country_field', new EE_Country_Select_Input(NULL, array('required'=>TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-country', 'html_label_text' => __('Country', 'event_espresso')))), |
|
35 | + 'zip' => new EE_Text_Input(array('required'=>TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-zip', 'html_label_text' => __('Zip', 'event_espresso'))), |
|
36 | + 'phone' => new EE_Text_Input(array('html_class' => 'ee-billing-qstn ee-billing-qstn-phone', 'html_label_text' => __('Phone', 'event_espresso'))), |
|
37 | 37 | ), |
38 | - isset( $options_array['subsections'] ) ? $options_array['subsections'] : array() |
|
38 | + isset($options_array['subsections']) ? $options_array['subsections'] : array() |
|
39 | 39 | ); |
40 | 40 | |
41 | - parent::__construct( $payment_method, $options_array ); |
|
41 | + parent::__construct($payment_method, $options_array); |
|
42 | 42 | |
43 | 43 | } |
44 | 44 | |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | * Sets the defaults for the billing form according to the attendee's details |
47 | 47 | * @param EE_Attendee $attendee |
48 | 48 | */ |
49 | - public function populate_from_attendee( $attendee ){ |
|
49 | + public function populate_from_attendee($attendee) { |
|
50 | 50 | $attendee = EEM_Attendee::instance()->ensure_is_obj($attendee); |
51 | 51 | /** @var $attendee EE_Attendee */ |
52 | 52 | $this->populate_defaults(array( |
@@ -71,48 +71,48 @@ discard block |
||
71 | 71 | * @param \EE_Attendee $attendee - the attendee object to copy details to |
72 | 72 | * @return \EE_Attendee |
73 | 73 | */ |
74 | - public function copy_billing_form_data_to_attendee( EE_Attendee $attendee ){ |
|
74 | + public function copy_billing_form_data_to_attendee(EE_Attendee $attendee) { |
|
75 | 75 | // grab billing form data |
76 | 76 | $data = $this->valid_data(); |
77 | 77 | // copy first_name |
78 | - if ( ! empty( $data['first_name'] )) { |
|
79 | - $attendee->set_fname( $data['first_name'] ); |
|
78 | + if ( ! empty($data['first_name'])) { |
|
79 | + $attendee->set_fname($data['first_name']); |
|
80 | 80 | } |
81 | 81 | // copy last_name |
82 | - if ( ! empty( $data['last_name'] )) { |
|
83 | - $attendee->set_lname( $data['last_name'] ); |
|
82 | + if ( ! empty($data['last_name'])) { |
|
83 | + $attendee->set_lname($data['last_name']); |
|
84 | 84 | } |
85 | 85 | // copy email |
86 | - if ( ! empty( $data['email'] )) { |
|
87 | - $attendee->set_email( $data['email'] ); |
|
86 | + if ( ! empty($data['email'])) { |
|
87 | + $attendee->set_email($data['email']); |
|
88 | 88 | } |
89 | 89 | // copy address |
90 | - if ( ! empty( $data['address'] )) { |
|
91 | - $attendee->set_address( $data['address'] ); |
|
90 | + if ( ! empty($data['address'])) { |
|
91 | + $attendee->set_address($data['address']); |
|
92 | 92 | } |
93 | 93 | // copy address2 |
94 | - if ( ! empty( $data['address2'] )) { |
|
95 | - $attendee->set_address2( $data['address2'] ); |
|
94 | + if ( ! empty($data['address2'])) { |
|
95 | + $attendee->set_address2($data['address2']); |
|
96 | 96 | } |
97 | 97 | // copy city |
98 | - if ( ! empty( $data['city'] )) { |
|
99 | - $attendee->set_city( $data['city'] ); |
|
98 | + if ( ! empty($data['city'])) { |
|
99 | + $attendee->set_city($data['city']); |
|
100 | 100 | } |
101 | 101 | // copy state |
102 | - if ( ! empty( $data['state'] )) { |
|
103 | - $attendee->set_state( $data['state'] ); |
|
102 | + if ( ! empty($data['state'])) { |
|
103 | + $attendee->set_state($data['state']); |
|
104 | 104 | } |
105 | 105 | // copy country |
106 | - if ( ! empty( $data['country'] )) { |
|
107 | - $attendee->set_country( $data['country'] ); |
|
106 | + if ( ! empty($data['country'])) { |
|
107 | + $attendee->set_country($data['country']); |
|
108 | 108 | } |
109 | 109 | // copy zip |
110 | - if ( ! empty( $data['zip'] )) { |
|
111 | - $attendee->set_zip( $data['zip'] ); |
|
110 | + if ( ! empty($data['zip'])) { |
|
111 | + $attendee->set_zip($data['zip']); |
|
112 | 112 | } |
113 | 113 | // copy phone |
114 | - if ( ! empty( $data['phone'] )) { |
|
115 | - $attendee->set_phone( $data['phone'] ); |
|
114 | + if ( ! empty($data['phone'])) { |
|
115 | + $attendee->set_phone($data['phone']); |
|
116 | 116 | } |
117 | 117 | return $attendee; |
118 | 118 | } |
@@ -123,20 +123,20 @@ discard block |
||
123 | 123 | * uses info from the billing form to create a new attendee |
124 | 124 | * @return \EE_Attendee |
125 | 125 | */ |
126 | - public function create_attendee_from_billing_form_data(){ |
|
126 | + public function create_attendee_from_billing_form_data() { |
|
127 | 127 | // grab billing form data |
128 | 128 | $data = $this->valid_data(); |
129 | - return EE_Attendee::new_instance( array( |
|
130 | - 'ATT_fname' => ! empty( $data['first_name'] ) ? $data['first_name'] : '', |
|
131 | - 'ATT_lname' => ! empty( $data['last_name'] ) ? $data['last_name'] : '', |
|
132 | - 'ATT_email' => ! empty( $data['email'] ) ? $data['email'] : '', |
|
133 | - 'ATT_address' => ! empty( $data['address'] ) ? $data['address'] : '', |
|
134 | - 'ATT_address2' => ! empty( $data['address2'] ) ? $data['address2'] : '', |
|
135 | - 'ATT_city' => ! empty( $data['city'] ) ? $data['city'] : '', |
|
136 | - 'STA_ID' => ! empty( $data['state'] ) ? $data['state'] : '', |
|
137 | - 'CNT_ISO' => ! empty( $data['country'] ) ? $data['country'] : '', |
|
138 | - 'ATT_zip' => ! empty( $data['zip'] ) ? $data['zip'] : '', |
|
139 | - 'ATT_phone' => ! empty( $data['phone'] ) ? $data['phone'] : '', |
|
129 | + return EE_Attendee::new_instance(array( |
|
130 | + 'ATT_fname' => ! empty($data['first_name']) ? $data['first_name'] : '', |
|
131 | + 'ATT_lname' => ! empty($data['last_name']) ? $data['last_name'] : '', |
|
132 | + 'ATT_email' => ! empty($data['email']) ? $data['email'] : '', |
|
133 | + 'ATT_address' => ! empty($data['address']) ? $data['address'] : '', |
|
134 | + 'ATT_address2' => ! empty($data['address2']) ? $data['address2'] : '', |
|
135 | + 'ATT_city' => ! empty($data['city']) ? $data['city'] : '', |
|
136 | + 'STA_ID' => ! empty($data['state']) ? $data['state'] : '', |
|
137 | + 'CNT_ISO' => ! empty($data['country']) ? $data['country'] : '', |
|
138 | + 'ATT_zip' => ! empty($data['zip']) ? $data['zip'] : '', |
|
139 | + 'ATT_phone' => ! empty($data['phone']) ? $data['phone'] : '', |
|
140 | 140 | )); |
141 | 141 | } |
142 | 142 | } |
@@ -45,6 +45,7 @@ |
||
45 | 45 | /** |
46 | 46 | * Sets the defaults for the billing form according to the attendee's details |
47 | 47 | * @param int | \EE_Attendee $attendee |
48 | + * @param EE_Attendee $attendee |
|
48 | 49 | */ |
49 | 50 | public function populate_from_attendee( $attendee ){ |
50 | 51 | $attendee = EEM_Attendee::instance()->ensure_is_obj($attendee); |