@@ -92,7 +92,7 @@ |
||
92 | 92 | $ticket_line_item |
93 | 93 | ); |
94 | 94 | $final_price = $final_price !== null ? $final_price : $ticket->get_ticket_total_with_taxes(); |
95 | - return (float)$final_price; |
|
95 | + return (float) $final_price; |
|
96 | 96 | } |
97 | 97 | |
98 | 98 |
@@ -39,8 +39,8 @@ |
||
39 | 39 | * @param EE_Transaction $transaction |
40 | 40 | * @param EE_Ticket $ticket |
41 | 41 | * @param EE_Line_Item $ticket_line_item |
42 | - * @param $reg_count |
|
43 | - * @param $reg_group_size |
|
42 | + * @param integer $reg_count |
|
43 | + * @param integer $reg_group_size |
|
44 | 44 | * @param string $reg_status |
45 | 45 | * @return EE_Registration |
46 | 46 | * @throws OutOfRangeException |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | use OutOfRangeException; |
18 | 18 | |
19 | 19 | if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
20 | - exit('No direct script access allowed'); |
|
20 | + exit('No direct script access allowed'); |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | |
@@ -41,54 +41,54 @@ discard block |
||
41 | 41 | * @param EE_Line_Item $ticket_line_item |
42 | 42 | * @param $reg_count |
43 | 43 | * @param $reg_group_size |
44 | - * @param string $reg_status |
|
45 | - * @return EE_Registration |
|
44 | + * @param string $reg_status |
|
45 | + * @return EE_Registration |
|
46 | 46 | * @throws OutOfRangeException |
47 | 47 | * @throws EE_Error |
48 | 48 | * @throws UnexpectedEntityException |
49 | 49 | */ |
50 | - public function create( |
|
51 | - EE_Event $event, |
|
52 | - EE_Transaction $transaction, |
|
53 | - EE_Ticket $ticket, |
|
54 | - EE_Line_Item $ticket_line_item, |
|
55 | - $reg_count, |
|
56 | - $reg_group_size, |
|
57 | - $reg_status = EEM_Registration::status_id_incomplete |
|
58 | - ) { |
|
59 | - $registrations = $transaction->registrations(); |
|
60 | - $reg_count = $reg_count ? $reg_count : count($registrations) + 1; |
|
61 | - $reg_url_link = new RegUrlLink($reg_count, $ticket_line_item); |
|
62 | - $reg_code = new RegCode($reg_url_link, $transaction, $ticket); |
|
63 | - // generate new EE_Registration |
|
64 | - $registration = EE_Registration::new_instance( |
|
65 | - array( |
|
66 | - 'EVT_ID' => $event->ID(), |
|
67 | - 'TXN_ID' => $transaction->ID(), |
|
68 | - 'TKT_ID' => $ticket->ID(), |
|
69 | - 'STS_ID' => $reg_status, |
|
70 | - 'REG_final_price' => $this->resolveFinalPrice($transaction, $ticket, $ticket_line_item), |
|
71 | - 'REG_session' => EE_Registry::instance()->SSN->id(), |
|
72 | - 'REG_count' => $reg_count, |
|
73 | - 'REG_group_size' => $reg_group_size ? $reg_group_size : $this->incrementRegCount($registrations), |
|
74 | - 'REG_url_link' => $reg_url_link, |
|
75 | - 'REG_code' => $reg_code, |
|
76 | - ) |
|
77 | - ); |
|
78 | - if ( ! $registration instanceof EE_Registration) { |
|
79 | - throw new UnexpectedEntityException($registration, 'EE_Registration'); |
|
80 | - } |
|
81 | - // save registration so that we have an ID |
|
82 | - $registration->save(); |
|
83 | - // track reservation on reg but don't adjust ticket and datetime reserved counts |
|
84 | - // because that is done as soon as the tickets are added/removed from the cart |
|
85 | - $registration->reserve_ticket(); |
|
86 | - $registration->_add_relation_to($event, 'Event', array(), $event->ID()); |
|
87 | - $registration->_add_relation_to($ticket, 'Ticket', array(), $ticket->ID()); |
|
88 | - $transaction->_add_relation_to($registration, 'Registration', array(), $registration->ID()); |
|
89 | - $registration->save(); |
|
90 | - return $registration; |
|
91 | - } |
|
50 | + public function create( |
|
51 | + EE_Event $event, |
|
52 | + EE_Transaction $transaction, |
|
53 | + EE_Ticket $ticket, |
|
54 | + EE_Line_Item $ticket_line_item, |
|
55 | + $reg_count, |
|
56 | + $reg_group_size, |
|
57 | + $reg_status = EEM_Registration::status_id_incomplete |
|
58 | + ) { |
|
59 | + $registrations = $transaction->registrations(); |
|
60 | + $reg_count = $reg_count ? $reg_count : count($registrations) + 1; |
|
61 | + $reg_url_link = new RegUrlLink($reg_count, $ticket_line_item); |
|
62 | + $reg_code = new RegCode($reg_url_link, $transaction, $ticket); |
|
63 | + // generate new EE_Registration |
|
64 | + $registration = EE_Registration::new_instance( |
|
65 | + array( |
|
66 | + 'EVT_ID' => $event->ID(), |
|
67 | + 'TXN_ID' => $transaction->ID(), |
|
68 | + 'TKT_ID' => $ticket->ID(), |
|
69 | + 'STS_ID' => $reg_status, |
|
70 | + 'REG_final_price' => $this->resolveFinalPrice($transaction, $ticket, $ticket_line_item), |
|
71 | + 'REG_session' => EE_Registry::instance()->SSN->id(), |
|
72 | + 'REG_count' => $reg_count, |
|
73 | + 'REG_group_size' => $reg_group_size ? $reg_group_size : $this->incrementRegCount($registrations), |
|
74 | + 'REG_url_link' => $reg_url_link, |
|
75 | + 'REG_code' => $reg_code, |
|
76 | + ) |
|
77 | + ); |
|
78 | + if ( ! $registration instanceof EE_Registration) { |
|
79 | + throw new UnexpectedEntityException($registration, 'EE_Registration'); |
|
80 | + } |
|
81 | + // save registration so that we have an ID |
|
82 | + $registration->save(); |
|
83 | + // track reservation on reg but don't adjust ticket and datetime reserved counts |
|
84 | + // because that is done as soon as the tickets are added/removed from the cart |
|
85 | + $registration->reserve_ticket(); |
|
86 | + $registration->_add_relation_to($event, 'Event', array(), $event->ID()); |
|
87 | + $registration->_add_relation_to($ticket, 'Ticket', array(), $ticket->ID()); |
|
88 | + $transaction->_add_relation_to($registration, 'Registration', array(), $registration->ID()); |
|
89 | + $registration->save(); |
|
90 | + return $registration; |
|
91 | + } |
|
92 | 92 | |
93 | 93 | |
94 | 94 | |
@@ -100,40 +100,40 @@ discard block |
||
100 | 100 | * @throws EE_Error |
101 | 101 | * @throws OutOfRangeException |
102 | 102 | */ |
103 | - protected function resolveFinalPrice( |
|
104 | - EE_Transaction $transaction, |
|
105 | - EE_Ticket $ticket, |
|
106 | - EE_Line_Item $ticket_line_item |
|
107 | - ) { |
|
108 | - $final_price = EEH_Line_Item::calculate_final_price_for_ticket_line_item( |
|
109 | - $transaction->total_line_item(), |
|
110 | - $ticket_line_item |
|
111 | - ); |
|
112 | - $final_price = $final_price !== null ? $final_price : $ticket->get_ticket_total_with_taxes(); |
|
113 | - return (float)$final_price; |
|
114 | - } |
|
103 | + protected function resolveFinalPrice( |
|
104 | + EE_Transaction $transaction, |
|
105 | + EE_Ticket $ticket, |
|
106 | + EE_Line_Item $ticket_line_item |
|
107 | + ) { |
|
108 | + $final_price = EEH_Line_Item::calculate_final_price_for_ticket_line_item( |
|
109 | + $transaction->total_line_item(), |
|
110 | + $ticket_line_item |
|
111 | + ); |
|
112 | + $final_price = $final_price !== null ? $final_price : $ticket->get_ticket_total_with_taxes(); |
|
113 | + return (float)$final_price; |
|
114 | + } |
|
115 | 115 | |
116 | 116 | |
117 | 117 | |
118 | - /** |
|
119 | - * @param EE_Registration[] $registrations |
|
120 | - * @param boolean $update_existing_registrations |
|
121 | - * @return int |
|
122 | - * @throws EE_Error |
|
123 | - */ |
|
124 | - protected function incrementRegCount(array $registrations, $update_existing_registrations = true) |
|
125 | - { |
|
126 | - $new_reg_count = count($registrations) + 1; |
|
127 | - if ($update_existing_registrations) { |
|
128 | - foreach ($registrations as $registration) { |
|
129 | - if ($registration instanceof EE_Registration) { |
|
130 | - $registration->set_count($new_reg_count); |
|
131 | - $registration->save(); |
|
132 | - } |
|
133 | - } |
|
134 | - } |
|
135 | - return $new_reg_count; |
|
136 | - } |
|
118 | + /** |
|
119 | + * @param EE_Registration[] $registrations |
|
120 | + * @param boolean $update_existing_registrations |
|
121 | + * @return int |
|
122 | + * @throws EE_Error |
|
123 | + */ |
|
124 | + protected function incrementRegCount(array $registrations, $update_existing_registrations = true) |
|
125 | + { |
|
126 | + $new_reg_count = count($registrations) + 1; |
|
127 | + if ($update_existing_registrations) { |
|
128 | + foreach ($registrations as $registration) { |
|
129 | + if ($registration instanceof EE_Registration) { |
|
130 | + $registration->set_count($new_reg_count); |
|
131 | + $registration->save(); |
|
132 | + } |
|
133 | + } |
|
134 | + } |
|
135 | + return $new_reg_count; |
|
136 | + } |
|
137 | 137 | |
138 | 138 | |
139 | 139 | } |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | use EventEspresso\core\exceptions\UnexpectedEntityException; |
6 | 6 | |
7 | 7 | if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
8 | - exit('No direct script access allowed'); |
|
8 | + exit('No direct script access allowed'); |
|
9 | 9 | } |
10 | 10 | |
11 | 11 | |
@@ -23,140 +23,140 @@ discard block |
||
23 | 23 | { |
24 | 24 | |
25 | 25 | |
26 | - /** |
|
27 | - * @param \EE_Registration $target_registration |
|
28 | - * @param \EE_Registration $registration_to_copy |
|
29 | - * @return bool |
|
30 | - * @throws \EE_Error |
|
31 | - */ |
|
32 | - public function copyRegistrationDetails( |
|
33 | - \EE_Registration $target_registration, |
|
34 | - \EE_Registration $registration_to_copy |
|
35 | - ) { |
|
36 | - // copy attendee |
|
37 | - $target_registration->set_attendee_id($registration_to_copy->attendee_ID()); |
|
38 | - $target_registration->set_status( $registration_to_copy->status_ID() ); |
|
39 | - $target_registration->save(); |
|
40 | - // get answers to previous reg questions |
|
41 | - $answers = $this->reindexAnswersByQuestionId($registration_to_copy->answers()); |
|
42 | - // get questions to new event reg form |
|
43 | - $new_event = $target_registration->event(); |
|
44 | - $question_groups = $new_event->question_groups( |
|
45 | - array( |
|
46 | - array( |
|
47 | - 'Event.EVT_ID' => $new_event->ID(), |
|
48 | - 'Event_Question_Group.EQG_primary' => $registration_to_copy->is_primary_registrant() |
|
49 | - ), |
|
50 | - 'order_by' => array('QSG_order' => 'ASC') |
|
51 | - ) |
|
52 | - ); |
|
53 | - foreach ($question_groups as $question_group) { |
|
54 | - if ($question_group instanceof \EE_Question_Group) { |
|
55 | - foreach ($question_group->questions() as $question) { |
|
56 | - if ($question instanceof \EE_Question) { |
|
57 | - $this->generateNewAnswer( |
|
58 | - $question, |
|
59 | - $target_registration, |
|
60 | - $answers |
|
61 | - ); |
|
62 | - } |
|
63 | - } |
|
64 | - } |
|
65 | - } |
|
66 | - return true; |
|
67 | - } |
|
68 | - |
|
69 | - |
|
70 | - |
|
71 | - /** |
|
72 | - * @param \EE_Answer[] $answers |
|
73 | - * @return array |
|
74 | - * @throws \EE_Error |
|
75 | - */ |
|
76 | - protected static function reindexAnswersByQuestionId(array $answers) |
|
77 | - { |
|
78 | - $reindexed_answers = array(); |
|
79 | - foreach ($answers as $answer) { |
|
80 | - if ($answer instanceof \EE_Answer) { |
|
81 | - $reindexed_answers[$answer->question_ID()] = $answer->value(); |
|
82 | - } |
|
83 | - } |
|
84 | - return $reindexed_answers; |
|
85 | - } |
|
86 | - |
|
87 | - |
|
88 | - |
|
89 | - /** |
|
90 | - * @param \EE_Question $question |
|
91 | - * @param \EE_Registration $registration |
|
92 | - * @param $previous_answers |
|
93 | - * @return \EE_Answer |
|
94 | - * @throws \EventEspresso\core\exceptions\UnexpectedEntityException |
|
95 | - * @throws \EE_Error |
|
96 | - */ |
|
97 | - protected static function generateNewAnswer( |
|
98 | - \EE_Question $question, |
|
99 | - \EE_Registration $registration, |
|
100 | - $previous_answers |
|
101 | - ) { |
|
102 | - $old_answer_value = isset($previous_answers[$question->ID()]) |
|
103 | - ? $previous_answers[$question->ID()] |
|
104 | - : ''; |
|
105 | - $new_answer = \EE_Answer::new_instance( |
|
106 | - array( |
|
107 | - 'QST_ID' => $question->ID(), |
|
108 | - 'REG_ID' => $registration->ID(), |
|
109 | - 'ANS_value' => $old_answer_value, |
|
110 | - ) |
|
111 | - ); |
|
112 | - if ( ! $new_answer instanceof \EE_Answer) { |
|
113 | - throw new UnexpectedEntityException($new_answer, 'EE_Answer'); |
|
114 | - } |
|
115 | - $new_answer->save(); |
|
116 | - return $new_answer; |
|
117 | - } |
|
118 | - |
|
119 | - |
|
120 | - |
|
121 | - /** |
|
122 | - * @param \EE_Registration $target_registration |
|
123 | - * @param \EE_Registration $registration_to_copy |
|
124 | - * @return bool |
|
125 | - * @throws \EE_Error |
|
126 | - */ |
|
127 | - public function copyPaymentDetails( |
|
128 | - \EE_Registration $target_registration, |
|
129 | - \EE_Registration $registration_to_copy |
|
130 | - ) { |
|
131 | - $previous_payments = $registration_to_copy->registration_payments(); |
|
132 | - foreach ($previous_payments as $previous_payment) { |
|
133 | - if ( |
|
134 | - $previous_payment instanceof \EE_Registration_Payment |
|
135 | - && $previous_payment->payment() instanceof \EE_Payment |
|
136 | - && $previous_payment->payment()->is_approved() |
|
137 | - ) { |
|
138 | - $new_registration_payment = \EE_Registration_Payment::new_instance( |
|
139 | - array( |
|
140 | - 'REG_ID' => $target_registration->ID(), |
|
141 | - 'PAY_ID' => $previous_payment->ID(), |
|
142 | - 'RPY_amount' => $previous_payment->amount(), |
|
143 | - ) |
|
144 | - ); |
|
145 | - if ( ! $new_registration_payment instanceof \EE_Registration_Payment) { |
|
146 | - throw new UnexpectedEntityException($new_registration_payment, 'EE_Registration_Payment'); |
|
147 | - } |
|
148 | - $new_registration_payment->save(); |
|
149 | - $target_registration->set_paid($previous_payment->amount()); |
|
150 | - $target_registration->save(); |
|
151 | - // if new reg payment is good, then set old reg payment amount to zero |
|
152 | - $previous_payment->set_amount(0); |
|
153 | - $previous_payment->save(); |
|
154 | - $registration_to_copy->set_paid(0); |
|
155 | - $registration_to_copy->save(); |
|
156 | - } |
|
157 | - } |
|
158 | - return true; |
|
159 | - } |
|
26 | + /** |
|
27 | + * @param \EE_Registration $target_registration |
|
28 | + * @param \EE_Registration $registration_to_copy |
|
29 | + * @return bool |
|
30 | + * @throws \EE_Error |
|
31 | + */ |
|
32 | + public function copyRegistrationDetails( |
|
33 | + \EE_Registration $target_registration, |
|
34 | + \EE_Registration $registration_to_copy |
|
35 | + ) { |
|
36 | + // copy attendee |
|
37 | + $target_registration->set_attendee_id($registration_to_copy->attendee_ID()); |
|
38 | + $target_registration->set_status( $registration_to_copy->status_ID() ); |
|
39 | + $target_registration->save(); |
|
40 | + // get answers to previous reg questions |
|
41 | + $answers = $this->reindexAnswersByQuestionId($registration_to_copy->answers()); |
|
42 | + // get questions to new event reg form |
|
43 | + $new_event = $target_registration->event(); |
|
44 | + $question_groups = $new_event->question_groups( |
|
45 | + array( |
|
46 | + array( |
|
47 | + 'Event.EVT_ID' => $new_event->ID(), |
|
48 | + 'Event_Question_Group.EQG_primary' => $registration_to_copy->is_primary_registrant() |
|
49 | + ), |
|
50 | + 'order_by' => array('QSG_order' => 'ASC') |
|
51 | + ) |
|
52 | + ); |
|
53 | + foreach ($question_groups as $question_group) { |
|
54 | + if ($question_group instanceof \EE_Question_Group) { |
|
55 | + foreach ($question_group->questions() as $question) { |
|
56 | + if ($question instanceof \EE_Question) { |
|
57 | + $this->generateNewAnswer( |
|
58 | + $question, |
|
59 | + $target_registration, |
|
60 | + $answers |
|
61 | + ); |
|
62 | + } |
|
63 | + } |
|
64 | + } |
|
65 | + } |
|
66 | + return true; |
|
67 | + } |
|
68 | + |
|
69 | + |
|
70 | + |
|
71 | + /** |
|
72 | + * @param \EE_Answer[] $answers |
|
73 | + * @return array |
|
74 | + * @throws \EE_Error |
|
75 | + */ |
|
76 | + protected static function reindexAnswersByQuestionId(array $answers) |
|
77 | + { |
|
78 | + $reindexed_answers = array(); |
|
79 | + foreach ($answers as $answer) { |
|
80 | + if ($answer instanceof \EE_Answer) { |
|
81 | + $reindexed_answers[$answer->question_ID()] = $answer->value(); |
|
82 | + } |
|
83 | + } |
|
84 | + return $reindexed_answers; |
|
85 | + } |
|
86 | + |
|
87 | + |
|
88 | + |
|
89 | + /** |
|
90 | + * @param \EE_Question $question |
|
91 | + * @param \EE_Registration $registration |
|
92 | + * @param $previous_answers |
|
93 | + * @return \EE_Answer |
|
94 | + * @throws \EventEspresso\core\exceptions\UnexpectedEntityException |
|
95 | + * @throws \EE_Error |
|
96 | + */ |
|
97 | + protected static function generateNewAnswer( |
|
98 | + \EE_Question $question, |
|
99 | + \EE_Registration $registration, |
|
100 | + $previous_answers |
|
101 | + ) { |
|
102 | + $old_answer_value = isset($previous_answers[$question->ID()]) |
|
103 | + ? $previous_answers[$question->ID()] |
|
104 | + : ''; |
|
105 | + $new_answer = \EE_Answer::new_instance( |
|
106 | + array( |
|
107 | + 'QST_ID' => $question->ID(), |
|
108 | + 'REG_ID' => $registration->ID(), |
|
109 | + 'ANS_value' => $old_answer_value, |
|
110 | + ) |
|
111 | + ); |
|
112 | + if ( ! $new_answer instanceof \EE_Answer) { |
|
113 | + throw new UnexpectedEntityException($new_answer, 'EE_Answer'); |
|
114 | + } |
|
115 | + $new_answer->save(); |
|
116 | + return $new_answer; |
|
117 | + } |
|
118 | + |
|
119 | + |
|
120 | + |
|
121 | + /** |
|
122 | + * @param \EE_Registration $target_registration |
|
123 | + * @param \EE_Registration $registration_to_copy |
|
124 | + * @return bool |
|
125 | + * @throws \EE_Error |
|
126 | + */ |
|
127 | + public function copyPaymentDetails( |
|
128 | + \EE_Registration $target_registration, |
|
129 | + \EE_Registration $registration_to_copy |
|
130 | + ) { |
|
131 | + $previous_payments = $registration_to_copy->registration_payments(); |
|
132 | + foreach ($previous_payments as $previous_payment) { |
|
133 | + if ( |
|
134 | + $previous_payment instanceof \EE_Registration_Payment |
|
135 | + && $previous_payment->payment() instanceof \EE_Payment |
|
136 | + && $previous_payment->payment()->is_approved() |
|
137 | + ) { |
|
138 | + $new_registration_payment = \EE_Registration_Payment::new_instance( |
|
139 | + array( |
|
140 | + 'REG_ID' => $target_registration->ID(), |
|
141 | + 'PAY_ID' => $previous_payment->ID(), |
|
142 | + 'RPY_amount' => $previous_payment->amount(), |
|
143 | + ) |
|
144 | + ); |
|
145 | + if ( ! $new_registration_payment instanceof \EE_Registration_Payment) { |
|
146 | + throw new UnexpectedEntityException($new_registration_payment, 'EE_Registration_Payment'); |
|
147 | + } |
|
148 | + $new_registration_payment->save(); |
|
149 | + $target_registration->set_paid($previous_payment->amount()); |
|
150 | + $target_registration->save(); |
|
151 | + // if new reg payment is good, then set old reg payment amount to zero |
|
152 | + $previous_payment->set_amount(0); |
|
153 | + $previous_payment->save(); |
|
154 | + $registration_to_copy->set_paid(0); |
|
155 | + $registration_to_copy->save(); |
|
156 | + } |
|
157 | + } |
|
158 | + return true; |
|
159 | + } |
|
160 | 160 | |
161 | 161 | |
162 | 162 | } |
@@ -35,7 +35,7 @@ |
||
35 | 35 | ) { |
36 | 36 | // copy attendee |
37 | 37 | $target_registration->set_attendee_id($registration_to_copy->attendee_ID()); |
38 | - $target_registration->set_status( $registration_to_copy->status_ID() ); |
|
38 | + $target_registration->set_status($registration_to_copy->status_ID()); |
|
39 | 39 | $target_registration->save(); |
40 | 40 | // get answers to previous reg questions |
41 | 41 | $answers = $this->reindexAnswersByQuestionId($registration_to_copy->answers()); |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace EventEspresso\core\domain\entities; |
3 | 3 | |
4 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
5 | - exit( 'No direct script access allowed' ); |
|
4 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
5 | + exit('No direct script access allowed'); |
|
6 | 6 | } |
7 | 7 | |
8 | 8 | |
@@ -38,17 +38,17 @@ discard block |
||
38 | 38 | \EE_Ticket $ticket |
39 | 39 | ) { |
40 | 40 | // figure out where to start parsing the reg code |
41 | - $chars = strpos( $reg_url_link, '-' ) + 5; |
|
41 | + $chars = strpos($reg_url_link, '-') + 5; |
|
42 | 42 | // TXN_ID + TKT_ID + first 3 and last 3 chars of reg_url_link |
43 | 43 | $this->reg_code = array( |
44 | 44 | $transaction->ID(), |
45 | 45 | $ticket->ID(), |
46 | - substr( $reg_url_link, 0, $chars ) |
|
46 | + substr($reg_url_link, 0, $chars) |
|
47 | 47 | ); |
48 | 48 | // now put it all together |
49 | 49 | $this->reg_code = apply_filters( |
50 | 50 | 'FHEE__Create__regCode__new_reg_code', |
51 | - implode( '-', $this->reg_code ), |
|
51 | + implode('-', $this->reg_code), |
|
52 | 52 | $transaction, |
53 | 53 | $ticket |
54 | 54 | ); |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | use EventEspresso\core\exceptions\InvalidDataTypeException; |
5 | 5 | |
6 | 6 | if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
7 | - exit('No direct script access allowed'); |
|
7 | + exit('No direct script access allowed'); |
|
8 | 8 | } |
9 | 9 | |
10 | 10 | |
@@ -23,35 +23,35 @@ discard block |
||
23 | 23 | { |
24 | 24 | |
25 | 25 | |
26 | - /** |
|
27 | - * @access public |
|
28 | - * @param mixed $command_bus_middleware_object |
|
29 | - * @param string $message |
|
30 | - * @param int $code |
|
31 | - * @param \Exception $previous |
|
32 | - */ |
|
33 | - public function __construct($command_bus_middleware_object, $message = '', $code = 0, \Exception $previous = null) |
|
34 | - { |
|
35 | - $command_bus_middleware = is_object($command_bus_middleware_object) |
|
36 | - ? get_class($command_bus_middleware_object) |
|
37 | - : gettype($command_bus_middleware_object); |
|
38 | - |
|
39 | - if (empty($message)) { |
|
40 | - $message = sprintf( |
|
41 | - __('The supplied Command Bus Middleware "%1$s" does not have a valid name. It should be in the following format: "{CommandName}Handler" ', |
|
42 | - 'event_espresso'), |
|
43 | - $command_bus_middleware |
|
44 | - ); |
|
45 | - } |
|
46 | - parent::__construct( |
|
47 | - '$command_bus_middleware', |
|
48 | - $command_bus_middleware, |
|
49 | - 'CommandBusMiddlewareInterface', |
|
50 | - $message, |
|
51 | - $code, |
|
52 | - $previous |
|
53 | - ); |
|
54 | - } |
|
26 | + /** |
|
27 | + * @access public |
|
28 | + * @param mixed $command_bus_middleware_object |
|
29 | + * @param string $message |
|
30 | + * @param int $code |
|
31 | + * @param \Exception $previous |
|
32 | + */ |
|
33 | + public function __construct($command_bus_middleware_object, $message = '', $code = 0, \Exception $previous = null) |
|
34 | + { |
|
35 | + $command_bus_middleware = is_object($command_bus_middleware_object) |
|
36 | + ? get_class($command_bus_middleware_object) |
|
37 | + : gettype($command_bus_middleware_object); |
|
38 | + |
|
39 | + if (empty($message)) { |
|
40 | + $message = sprintf( |
|
41 | + __('The supplied Command Bus Middleware "%1$s" does not have a valid name. It should be in the following format: "{CommandName}Handler" ', |
|
42 | + 'event_espresso'), |
|
43 | + $command_bus_middleware |
|
44 | + ); |
|
45 | + } |
|
46 | + parent::__construct( |
|
47 | + '$command_bus_middleware', |
|
48 | + $command_bus_middleware, |
|
49 | + 'CommandBusMiddlewareInterface', |
|
50 | + $message, |
|
51 | + $code, |
|
52 | + $previous |
|
53 | + ); |
|
54 | + } |
|
55 | 55 | |
56 | 56 | |
57 | 57 | } |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | use EventEspresso\core\services\commands\Command; |
5 | 5 | |
6 | 6 | if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
7 | - exit('No direct script access allowed'); |
|
7 | + exit('No direct script access allowed'); |
|
8 | 8 | } |
9 | 9 | |
10 | 10 | |
@@ -21,121 +21,121 @@ discard block |
||
21 | 21 | { |
22 | 22 | |
23 | 23 | |
24 | - /** |
|
25 | - * @var \EE_Transaction $transaction |
|
26 | - */ |
|
27 | - private $transaction; |
|
28 | - |
|
29 | - /** |
|
30 | - * @var \EE_Ticket $ticket |
|
31 | - */ |
|
32 | - private $ticket; |
|
33 | - |
|
34 | - /** |
|
35 | - * @var \EE_Line_Item $ticket_line_item |
|
36 | - */ |
|
37 | - protected $ticket_line_item; |
|
38 | - |
|
39 | - /** |
|
40 | - * @var int $quantity |
|
41 | - */ |
|
42 | - protected $quantity; |
|
43 | - |
|
44 | - |
|
45 | - |
|
46 | - /** |
|
47 | - * @param \EE_Registration $registration |
|
48 | - * @param int $quantity |
|
49 | - */ |
|
50 | - public static function fromRegistration(\EE_Registration $registration, $quantity = 1) |
|
51 | - { |
|
52 | - new self( |
|
53 | - $registration->transaction(), |
|
54 | - $registration->ticket(), |
|
55 | - 1, |
|
56 | - $registration->ticket_line_item() |
|
57 | - ); |
|
58 | - } |
|
59 | - |
|
60 | - |
|
61 | - |
|
62 | - /** |
|
63 | - * @param \EE_Line_Item $ticket_line_item |
|
64 | - * @param int $quantity |
|
65 | - */ |
|
66 | - public static function fromTicketLineItem( |
|
67 | - \EE_Line_Item $ticket_line_item, |
|
68 | - $quantity = 1 |
|
69 | - ) { |
|
70 | - new self( |
|
71 | - $ticket_line_item->transaction(), |
|
72 | - $ticket_line_item->ticket(), |
|
73 | - $quantity, |
|
74 | - $ticket_line_item |
|
75 | - ); |
|
76 | - } |
|
77 | - |
|
78 | - |
|
79 | - |
|
80 | - /** |
|
81 | - * CancelTicketLineItemCommand constructor. |
|
82 | - * |
|
83 | - * @param \EE_Transaction $transaction |
|
84 | - * @param \EE_Ticket $ticket |
|
85 | - * @param int $quantity |
|
86 | - * @param \EE_Line_Item $ticket_line_item |
|
87 | - */ |
|
88 | - public function __construct( |
|
89 | - \EE_Transaction $transaction, |
|
90 | - \EE_Ticket $ticket, |
|
91 | - $quantity = 1, |
|
92 | - \EE_Line_Item $ticket_line_item = null |
|
93 | - ) { |
|
94 | - $this->transaction = $transaction; |
|
95 | - $this->ticket = $ticket; |
|
96 | - $this->quantity = min(1, absint($quantity)); |
|
97 | - $this->ticket_line_item = $ticket_line_item; |
|
98 | - } |
|
99 | - |
|
100 | - |
|
101 | - |
|
102 | - /** |
|
103 | - * @return \EE_Transaction |
|
104 | - */ |
|
105 | - public function transaction() |
|
106 | - { |
|
107 | - return $this->transaction; |
|
108 | - } |
|
109 | - |
|
110 | - |
|
111 | - |
|
112 | - /** |
|
113 | - * @return \EE_Ticket |
|
114 | - */ |
|
115 | - public function ticket() |
|
116 | - { |
|
117 | - return $this->ticket; |
|
118 | - } |
|
119 | - |
|
120 | - |
|
121 | - |
|
122 | - /** |
|
123 | - * @return \EE_Line_Item |
|
124 | - */ |
|
125 | - public function ticketLineItem() |
|
126 | - { |
|
127 | - return $this->ticket_line_item; |
|
128 | - } |
|
129 | - |
|
130 | - |
|
131 | - |
|
132 | - /** |
|
133 | - * @return int |
|
134 | - */ |
|
135 | - public function quantity() |
|
136 | - { |
|
137 | - return $this->quantity; |
|
138 | - } |
|
24 | + /** |
|
25 | + * @var \EE_Transaction $transaction |
|
26 | + */ |
|
27 | + private $transaction; |
|
28 | + |
|
29 | + /** |
|
30 | + * @var \EE_Ticket $ticket |
|
31 | + */ |
|
32 | + private $ticket; |
|
33 | + |
|
34 | + /** |
|
35 | + * @var \EE_Line_Item $ticket_line_item |
|
36 | + */ |
|
37 | + protected $ticket_line_item; |
|
38 | + |
|
39 | + /** |
|
40 | + * @var int $quantity |
|
41 | + */ |
|
42 | + protected $quantity; |
|
43 | + |
|
44 | + |
|
45 | + |
|
46 | + /** |
|
47 | + * @param \EE_Registration $registration |
|
48 | + * @param int $quantity |
|
49 | + */ |
|
50 | + public static function fromRegistration(\EE_Registration $registration, $quantity = 1) |
|
51 | + { |
|
52 | + new self( |
|
53 | + $registration->transaction(), |
|
54 | + $registration->ticket(), |
|
55 | + 1, |
|
56 | + $registration->ticket_line_item() |
|
57 | + ); |
|
58 | + } |
|
59 | + |
|
60 | + |
|
61 | + |
|
62 | + /** |
|
63 | + * @param \EE_Line_Item $ticket_line_item |
|
64 | + * @param int $quantity |
|
65 | + */ |
|
66 | + public static function fromTicketLineItem( |
|
67 | + \EE_Line_Item $ticket_line_item, |
|
68 | + $quantity = 1 |
|
69 | + ) { |
|
70 | + new self( |
|
71 | + $ticket_line_item->transaction(), |
|
72 | + $ticket_line_item->ticket(), |
|
73 | + $quantity, |
|
74 | + $ticket_line_item |
|
75 | + ); |
|
76 | + } |
|
77 | + |
|
78 | + |
|
79 | + |
|
80 | + /** |
|
81 | + * CancelTicketLineItemCommand constructor. |
|
82 | + * |
|
83 | + * @param \EE_Transaction $transaction |
|
84 | + * @param \EE_Ticket $ticket |
|
85 | + * @param int $quantity |
|
86 | + * @param \EE_Line_Item $ticket_line_item |
|
87 | + */ |
|
88 | + public function __construct( |
|
89 | + \EE_Transaction $transaction, |
|
90 | + \EE_Ticket $ticket, |
|
91 | + $quantity = 1, |
|
92 | + \EE_Line_Item $ticket_line_item = null |
|
93 | + ) { |
|
94 | + $this->transaction = $transaction; |
|
95 | + $this->ticket = $ticket; |
|
96 | + $this->quantity = min(1, absint($quantity)); |
|
97 | + $this->ticket_line_item = $ticket_line_item; |
|
98 | + } |
|
99 | + |
|
100 | + |
|
101 | + |
|
102 | + /** |
|
103 | + * @return \EE_Transaction |
|
104 | + */ |
|
105 | + public function transaction() |
|
106 | + { |
|
107 | + return $this->transaction; |
|
108 | + } |
|
109 | + |
|
110 | + |
|
111 | + |
|
112 | + /** |
|
113 | + * @return \EE_Ticket |
|
114 | + */ |
|
115 | + public function ticket() |
|
116 | + { |
|
117 | + return $this->ticket; |
|
118 | + } |
|
119 | + |
|
120 | + |
|
121 | + |
|
122 | + /** |
|
123 | + * @return \EE_Line_Item |
|
124 | + */ |
|
125 | + public function ticketLineItem() |
|
126 | + { |
|
127 | + return $this->ticket_line_item; |
|
128 | + } |
|
129 | + |
|
130 | + |
|
131 | + |
|
132 | + /** |
|
133 | + * @return int |
|
134 | + */ |
|
135 | + public function quantity() |
|
136 | + { |
|
137 | + return $this->quantity; |
|
138 | + } |
|
139 | 139 | |
140 | 140 | |
141 | 141 | } |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | use EventEspresso\core\services\commands\CommandInterface; |
8 | 8 | |
9 | 9 | if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
10 | - exit('No direct script access allowed'); |
|
10 | + exit('No direct script access allowed'); |
|
11 | 11 | } |
12 | 12 | |
13 | 13 | |
@@ -27,42 +27,42 @@ discard block |
||
27 | 27 | { |
28 | 28 | |
29 | 29 | |
30 | - /** |
|
31 | - * @var CancelTicketLineItemService $cancel_ticket_line_item_service |
|
32 | - */ |
|
33 | - private $cancel_ticket_line_item_service; |
|
30 | + /** |
|
31 | + * @var CancelTicketLineItemService $cancel_ticket_line_item_service |
|
32 | + */ |
|
33 | + private $cancel_ticket_line_item_service; |
|
34 | 34 | |
35 | 35 | |
36 | 36 | |
37 | - /** |
|
38 | - * Command constructor |
|
39 | - * |
|
40 | - * @param CancelTicketLineItemService $cancel_ticket_line_item_service |
|
41 | - */ |
|
42 | - public function __construct(CancelTicketLineItemService $cancel_ticket_line_item_service) |
|
43 | - { |
|
44 | - $this->cancel_ticket_line_item_service = $cancel_ticket_line_item_service; |
|
45 | - } |
|
37 | + /** |
|
38 | + * Command constructor |
|
39 | + * |
|
40 | + * @param CancelTicketLineItemService $cancel_ticket_line_item_service |
|
41 | + */ |
|
42 | + public function __construct(CancelTicketLineItemService $cancel_ticket_line_item_service) |
|
43 | + { |
|
44 | + $this->cancel_ticket_line_item_service = $cancel_ticket_line_item_service; |
|
45 | + } |
|
46 | 46 | |
47 | 47 | |
48 | 48 | |
49 | - /** |
|
50 | - * @param \EventEspresso\core\services\commands\CommandInterface $command |
|
51 | - * @return mixed |
|
52 | - */ |
|
53 | - public function handle(CommandInterface $command) |
|
54 | - { |
|
55 | - /** @var CancelTicketLineItemCommand $command */ |
|
56 | - if ( ! $command instanceof CancelTicketLineItemCommand) { |
|
57 | - throw new InvalidEntityException(get_class($command), 'CancelTicketLineItemCommand'); |
|
58 | - } |
|
59 | - return $this->cancel_ticket_line_item_service->cancel( |
|
60 | - $command->transaction(), |
|
61 | - $command->ticket(), |
|
62 | - $command->quantity(), |
|
63 | - $command->ticketLineItem() |
|
64 | - ); |
|
65 | - } |
|
49 | + /** |
|
50 | + * @param \EventEspresso\core\services\commands\CommandInterface $command |
|
51 | + * @return mixed |
|
52 | + */ |
|
53 | + public function handle(CommandInterface $command) |
|
54 | + { |
|
55 | + /** @var CancelTicketLineItemCommand $command */ |
|
56 | + if ( ! $command instanceof CancelTicketLineItemCommand) { |
|
57 | + throw new InvalidEntityException(get_class($command), 'CancelTicketLineItemCommand'); |
|
58 | + } |
|
59 | + return $this->cancel_ticket_line_item_service->cancel( |
|
60 | + $command->transaction(), |
|
61 | + $command->ticket(), |
|
62 | + $command->quantity(), |
|
63 | + $command->ticketLineItem() |
|
64 | + ); |
|
65 | + } |
|
66 | 66 | |
67 | 67 | |
68 | 68 | } |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | use EventEspresso\core\services\commands\CommandInterface; |
8 | 8 | |
9 | 9 | if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
10 | - exit('No direct script access allowed'); |
|
10 | + exit('No direct script access allowed'); |
|
11 | 11 | } |
12 | 12 | |
13 | 13 | |
@@ -25,40 +25,40 @@ discard block |
||
25 | 25 | { |
26 | 26 | |
27 | 27 | |
28 | - /** |
|
29 | - * @var CopyRegistrationService $copy_registration_service |
|
30 | - */ |
|
31 | - private $copy_registration_service; |
|
28 | + /** |
|
29 | + * @var CopyRegistrationService $copy_registration_service |
|
30 | + */ |
|
31 | + private $copy_registration_service; |
|
32 | 32 | |
33 | 33 | |
34 | 34 | |
35 | - /** |
|
36 | - * Command constructor |
|
37 | - * |
|
38 | - * @param CopyRegistrationService $copy_registration_service |
|
39 | - */ |
|
40 | - public function __construct(CopyRegistrationService $copy_registration_service) |
|
41 | - { |
|
42 | - $this->copy_registration_service = $copy_registration_service; |
|
43 | - } |
|
35 | + /** |
|
36 | + * Command constructor |
|
37 | + * |
|
38 | + * @param CopyRegistrationService $copy_registration_service |
|
39 | + */ |
|
40 | + public function __construct(CopyRegistrationService $copy_registration_service) |
|
41 | + { |
|
42 | + $this->copy_registration_service = $copy_registration_service; |
|
43 | + } |
|
44 | 44 | |
45 | 45 | |
46 | 46 | |
47 | - /** |
|
48 | - * @param \EventEspresso\core\services\commands\CommandInterface $command |
|
49 | - * @return boolean |
|
50 | - */ |
|
51 | - public function handle(CommandInterface $command) |
|
52 | - { |
|
53 | - /** @var CopyRegistrationDetailsCommand $command */ |
|
54 | - if ( ! $command instanceof CopyRegistrationDetailsCommand) { |
|
55 | - throw new InvalidEntityException(get_class($command), 'CopyRegistrationDetailsCommand'); |
|
56 | - } |
|
57 | - return $this->copy_registration_service->copyRegistrationDetails( |
|
58 | - $command->targetRegistration(), |
|
59 | - $command->registrationToCopy() |
|
60 | - ); |
|
61 | - } |
|
47 | + /** |
|
48 | + * @param \EventEspresso\core\services\commands\CommandInterface $command |
|
49 | + * @return boolean |
|
50 | + */ |
|
51 | + public function handle(CommandInterface $command) |
|
52 | + { |
|
53 | + /** @var CopyRegistrationDetailsCommand $command */ |
|
54 | + if ( ! $command instanceof CopyRegistrationDetailsCommand) { |
|
55 | + throw new InvalidEntityException(get_class($command), 'CopyRegistrationDetailsCommand'); |
|
56 | + } |
|
57 | + return $this->copy_registration_service->copyRegistrationDetails( |
|
58 | + $command->targetRegistration(), |
|
59 | + $command->registrationToCopy() |
|
60 | + ); |
|
61 | + } |
|
62 | 62 | |
63 | 63 | |
64 | 64 | } |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | use EventEspresso\core\services\commands\CommandInterface; |
8 | 8 | |
9 | 9 | if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
10 | - exit('No direct script access allowed'); |
|
10 | + exit('No direct script access allowed'); |
|
11 | 11 | } |
12 | 12 | |
13 | 13 | |
@@ -24,42 +24,42 @@ discard block |
||
24 | 24 | { |
25 | 25 | |
26 | 26 | |
27 | - /** |
|
28 | - * @var CancelTicketLineItemService $cancel_ticket_line_item_service |
|
29 | - */ |
|
30 | - private $cancel_ticket_line_item_service; |
|
31 | - |
|
32 | - |
|
33 | - |
|
34 | - /** |
|
35 | - * Command constructor |
|
36 | - * |
|
37 | - * @param CancelTicketLineItemService $cancel_ticket_line_item_service |
|
38 | - */ |
|
39 | - public function __construct(CancelTicketLineItemService $cancel_ticket_line_item_service) |
|
40 | - { |
|
41 | - $this->cancel_ticket_line_item_service = $cancel_ticket_line_item_service; |
|
42 | - } |
|
43 | - |
|
44 | - |
|
45 | - |
|
46 | - /** |
|
47 | - * @param \EventEspresso\core\services\commands\CommandInterface $command |
|
48 | - * @return boolean |
|
49 | - */ |
|
50 | - public function handle(CommandInterface $command) |
|
51 | - { |
|
52 | - /** @var CancelRegistrationAndTicketLineItemCommand $command */ |
|
53 | - if ( ! $command instanceof CancelRegistrationAndTicketLineItemCommand) { |
|
54 | - throw new InvalidEntityException(get_class($command), 'CancelRegistrationAndTicketLineItemCommand'); |
|
55 | - } |
|
56 | - $registration = $command->registration(); |
|
57 | - $this->cancel_ticket_line_item_service->forRegistration($registration); |
|
58 | - // cancel original registration |
|
59 | - $registration->set_status(\EEM_Registration::status_id_cancelled); |
|
60 | - $registration->save(); |
|
61 | - return true; |
|
62 | - } |
|
27 | + /** |
|
28 | + * @var CancelTicketLineItemService $cancel_ticket_line_item_service |
|
29 | + */ |
|
30 | + private $cancel_ticket_line_item_service; |
|
31 | + |
|
32 | + |
|
33 | + |
|
34 | + /** |
|
35 | + * Command constructor |
|
36 | + * |
|
37 | + * @param CancelTicketLineItemService $cancel_ticket_line_item_service |
|
38 | + */ |
|
39 | + public function __construct(CancelTicketLineItemService $cancel_ticket_line_item_service) |
|
40 | + { |
|
41 | + $this->cancel_ticket_line_item_service = $cancel_ticket_line_item_service; |
|
42 | + } |
|
43 | + |
|
44 | + |
|
45 | + |
|
46 | + /** |
|
47 | + * @param \EventEspresso\core\services\commands\CommandInterface $command |
|
48 | + * @return boolean |
|
49 | + */ |
|
50 | + public function handle(CommandInterface $command) |
|
51 | + { |
|
52 | + /** @var CancelRegistrationAndTicketLineItemCommand $command */ |
|
53 | + if ( ! $command instanceof CancelRegistrationAndTicketLineItemCommand) { |
|
54 | + throw new InvalidEntityException(get_class($command), 'CancelRegistrationAndTicketLineItemCommand'); |
|
55 | + } |
|
56 | + $registration = $command->registration(); |
|
57 | + $this->cancel_ticket_line_item_service->forRegistration($registration); |
|
58 | + // cancel original registration |
|
59 | + $registration->set_status(\EEM_Registration::status_id_cancelled); |
|
60 | + $registration->save(); |
|
61 | + return true; |
|
62 | + } |
|
63 | 63 | |
64 | 64 | |
65 | 65 |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | use EventEspresso\core\services\commands\CommandInterface; |
8 | 8 | |
9 | 9 | if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
10 | - exit('No direct script access allowed'); |
|
10 | + exit('No direct script access allowed'); |
|
11 | 11 | } |
12 | 12 | |
13 | 13 | |
@@ -26,40 +26,40 @@ discard block |
||
26 | 26 | { |
27 | 27 | |
28 | 28 | |
29 | - /** |
|
30 | - * @var CopyRegistrationService $copy_registration_service |
|
31 | - */ |
|
32 | - private $copy_registration_service; |
|
33 | - |
|
34 | - |
|
35 | - |
|
36 | - /** |
|
37 | - * Command constructor |
|
38 | - * |
|
39 | - * @param CopyRegistrationService $copy_registration_service |
|
40 | - */ |
|
41 | - public function __construct(CopyRegistrationService $copy_registration_service) |
|
42 | - { |
|
43 | - $this->copy_registration_service = $copy_registration_service; |
|
44 | - } |
|
45 | - |
|
46 | - |
|
47 | - |
|
48 | - /** |
|
49 | - * @param \EventEspresso\core\services\commands\CommandInterface $command |
|
50 | - * @return boolean |
|
51 | - */ |
|
52 | - public function handle(CommandInterface $command) |
|
53 | - { |
|
54 | - /** @var CopyRegistrationPaymentsCommand $command */ |
|
55 | - if ( ! $command instanceof CopyRegistrationPaymentsCommand) { |
|
56 | - throw new InvalidEntityException(get_class($command), 'CopyRegistrationPaymentsCommand'); |
|
57 | - } |
|
58 | - return $this->copy_registration_service->copyPaymentDetails( |
|
59 | - $command->targetRegistration(), |
|
60 | - $command->registrationToCopy() |
|
61 | - ); |
|
62 | - } |
|
29 | + /** |
|
30 | + * @var CopyRegistrationService $copy_registration_service |
|
31 | + */ |
|
32 | + private $copy_registration_service; |
|
33 | + |
|
34 | + |
|
35 | + |
|
36 | + /** |
|
37 | + * Command constructor |
|
38 | + * |
|
39 | + * @param CopyRegistrationService $copy_registration_service |
|
40 | + */ |
|
41 | + public function __construct(CopyRegistrationService $copy_registration_service) |
|
42 | + { |
|
43 | + $this->copy_registration_service = $copy_registration_service; |
|
44 | + } |
|
45 | + |
|
46 | + |
|
47 | + |
|
48 | + /** |
|
49 | + * @param \EventEspresso\core\services\commands\CommandInterface $command |
|
50 | + * @return boolean |
|
51 | + */ |
|
52 | + public function handle(CommandInterface $command) |
|
53 | + { |
|
54 | + /** @var CopyRegistrationPaymentsCommand $command */ |
|
55 | + if ( ! $command instanceof CopyRegistrationPaymentsCommand) { |
|
56 | + throw new InvalidEntityException(get_class($command), 'CopyRegistrationPaymentsCommand'); |
|
57 | + } |
|
58 | + return $this->copy_registration_service->copyPaymentDetails( |
|
59 | + $command->targetRegistration(), |
|
60 | + $command->registrationToCopy() |
|
61 | + ); |
|
62 | + } |
|
63 | 63 | |
64 | 64 | |
65 | 65 |