@@ -140,12 +140,12 @@ public function getStartDate()
140140 /**
141141 * Set the request startDate
142142 *
143- * @param string $value
143+ * @param string|DateTime $value
144144 * @return RestSearchTransactionRequest provides a fluent interface.
145145 */
146146 public function setStartDate ($ value )
147147 {
148- return $ this ->setParameter ('startDate ' , $ value );
148+ return $ this ->setParameter ('startDate ' , is_string ( $ value ) ? new \ DateTime ( $ value ) : $ value );
149149 }
150150
151151 /**
@@ -161,20 +161,20 @@ public function getEndDate()
161161 /**
162162 * Set the request endDate
163163 *
164- * @param string $value
164+ * @param string|DateTime $value
165165 * @return RestSearchTransactionRequest provides a fluent interface.
166166 */
167167 public function setEndDate ($ value )
168168 {
169- return $ this ->setParameter ('endDate ' , $ value );
169+ return $ this ->setParameter ('endDate ' , is_string ( $ value ) ? new \ DateTime ( $ value ) : $ value );
170170 }
171171
172172 public function getData ()
173173 {
174- $ this ->validate ('agreementId ' );
174+ $ this ->validate ('agreementId ' , ' startDate ' , ' endDate ' );
175175 return array (
176- 'start_date ' => $ this ->getStartDate (),
177- 'end_date ' => $ this ->getEndDate (),
176+ 'start_date ' => $ this ->getStartDate ()-> format ( ' Y-m-d ' ),
177+ 'end_date ' => $ this ->getEndDate ()-> format ( ' Y-m-d ' ),
178178 );
179179 }
180180
0 commit comments