public static function is_expired(data_request $request) {
        $result = false;

        // Only export requests expire.
        if ($request->get('type') == api::DATAREQUEST_TYPE_EXPORT) {
            switch ($request->get('status')) {
                // Expired requests are obviously expired.
                case api::DATAREQUEST_STATUS_EXPIRED:
                    $result = true;
                    break;
                // Complete requests are expired if the expiry time has elapsed.
                case api::DATAREQUEST_STATUS_DOWNLOAD_READY:
                    $expiryseconds = get_config('tool_dataprivacy', 'privacyrequestexpiry');
                    if ($expiryseconds > 0 && time() >= ($request->get('timemodified') + $expiryseconds)) {
                        $result = true;
                    }
                    break;
            }
        }

        return $result;
    }
public static function is_expired(data_request $request) {
        $result = false;

        // Only export requests expire.
        if ($request->get('type') == api::DATAREQUEST_TYPE_EXPORT) {
            switch ($request->get('status')) {
                // Expired requests are obviously expired.
                case api::DATAREQUEST_STATUS_EXPIRED:
                    $result = true;
                    break;
                // Complete requests are expired if the expiry time has elapsed.
                case api::DATAREQUEST_STATUS_DOWNLOAD_READY:
                    $expiryseconds = get_config('tool_dataprivacy', 'privacyrequestexpiry');
                    if ($expiryseconds > 0 && time() >= ($request->get('timemodified') + $expiryseconds)) {
                        $result = true;
                    }
                    break;
            }
        }

        return $result;
    }
public static function is_expired ( data_request $ request ) { $ result = false ; // Only export requests expire. if ( $ request -> get ( 'type' ) == api :: DATAREQUEST_TYPE_EXPORT ) { switch ( $ request -> get ( 'status' ) ) { // Expired requests are obviously expired. case api :: DATAREQUEST_STATUS_EXPIRED : $ result = true ; break ; // Complete requests are expired if the expiry time has elapsed. case api :: DATAREQUEST_STATUS_DOWNLOAD_READY : $ expiryseconds = get_config ( 'tool_dataprivacy' , 'privacyrequestexpiry' ) ; if ( $ expiryseconds > 0 && time ( ) >= ( $ request -> get ( 'timemodified' ) + $ expiryseconds ) ) { $ result = true ; } break ; } } return $ result ; }
Determines whether a completed data export request has expired.
The response will be valid regardless of the expiry scheduled task having run.

@param data_request $request the data request object whose expiry will be checked.
@return bool true if the request has expired.
Determines whether a completed data export request has expired . The response will be valid regardless of the expiry scheduled task having run .