src/Service/Coupon/CouponService.php
public function getCoupons($code = null)
    {
        $requestData = new Get\RequestData($code);
        $request = new Get\Request($requestData);

        $apiResponse = $this->sendRequest($request, Get\ApiResponse::class);
        /** @var Get\Response $response */
        $response = $apiResponse->getResponse();
        foreach ($response->getCoupons() as $coupon) {
            $validFrom = $coupon->getValidFrom();
            if ($validFrom !== null) {
                $validFrom->setTime(0, 0, 0);
            }

            $validTo = $coupon->getValidTo();
            if ($validTo !== null) {
                $validTo->setTime(0, 0, 0);
            }
        }

        return $apiResponse;
    }
public function getCoupons($code = null)
    {
        $requestData = new Get\RequestData($code);
        $request = new Get\Request($requestData);

        $apiResponse = $this->sendRequest($request, Get\ApiResponse::class);
        /** @var Get\Response $response */
        $response = $apiResponse->getResponse();
        foreach ($response->getCoupons() as $coupon) {
            $validFrom = $coupon->getValidFrom();
            if ($validFrom !== null) {
                $validFrom->setTime(0, 0, 0);
            }

            $validTo = $coupon->getValidTo();
            if ($validTo !== null) {
                $validTo->setTime(0, 0, 0);
            }
        }

        return $apiResponse;
    }
public function getCoupons ( $ code = null ) { $ requestData = new Get \ RequestData ( $ code ) ; $ request = new Get \ Request ( $ requestData ) ; $ apiResponse = $ this -> sendRequest ( $ request , Get \ ApiResponse :: class ) ; /** @var Get\Response $response */ $ response = $ apiResponse -> getResponse ( ) ; foreach ( $ response -> getCoupons ( ) as $ coupon ) { $ validFrom = $ coupon -> getValidFrom ( ) ; if ( $ validFrom !== null ) { $ validFrom -> setTime ( 0 , 0 , 0 ) ; } $ validTo = $ coupon -> getValidTo ( ) ; if ( $ validTo !== null ) { $ validTo -> setTime ( 0 , 0 , 0 ) ; } } return $ apiResponse ; }
Get the coupons.

@param string $code The code to get.
@return Get\ApiResponse
Get the coupons .