@@ 128-143 (lines=16) @@ | ||
125 | * @param DataObject $data |
|
126 | * @return string|false |
|
127 | */ |
|
128 | protected function getFormattedBirthday(DataObject $data) |
|
129 | { |
|
130 | $sFormattedDob = false; |
|
131 | ||
132 | $sBirthday = $this->toolkitHelper->getAdditionalDataEntry($data, 'birthday'); |
|
133 | $sBirthmonth = $this->toolkitHelper->getAdditionalDataEntry($data, 'birthmonth'); |
|
134 | $sBirthyear = $this->toolkitHelper->getAdditionalDataEntry($data, 'birthyear'); |
|
135 | if ($sBirthday && $sBirthmonth && $sBirthyear) { |
|
136 | $sDob = $sBirthyear.'-'.$sBirthmonth.'-'.$sBirthday; |
|
137 | $iDobTime = strtotime($sDob); |
|
138 | if ($iDobTime !== false) { |
|
139 | $sFormattedDob = date('Ymd', $iDobTime); |
|
140 | } |
|
141 | } |
|
142 | return $sFormattedDob; |
|
143 | } |
|
144 | ||
145 | /** |
|
146 | * Add the checkout-form-data to the checkout session |
@@ 83-98 (lines=16) @@ | ||
80 | * @param DataObject $data |
|
81 | * @return string|false |
|
82 | */ |
|
83 | protected function getFormattedBirthday(DataObject $data) |
|
84 | { |
|
85 | $sFormattedDob = false; |
|
86 | ||
87 | $sBirthday = $this->toolkitHelper->getAdditionalDataEntry($data, 'birthday'); |
|
88 | $sBirthmonth = $this->toolkitHelper->getAdditionalDataEntry($data, 'birthmonth'); |
|
89 | $sBirthyear = $this->toolkitHelper->getAdditionalDataEntry($data, 'birthyear'); |
|
90 | if ($sBirthday && $sBirthmonth && $sBirthyear) { |
|
91 | $sDob = $sBirthyear.'-'.$sBirthmonth.'-'.$sBirthday; |
|
92 | $iDobTime = strtotime($sDob); |
|
93 | if ($iDobTime !== false) { |
|
94 | $sFormattedDob = date('Ymd', $iDobTime); |
|
95 | } |
|
96 | } |
|
97 | return $sFormattedDob; |
|
98 | } |
|
99 | ||
100 | /** |
|
101 | * Add the checkout-form-data to the checkout session |