# give/4.16.8.1/src/DonationForms/AsyncData/AsyncDataHelpers.php

GiveWP – Donation Plugin and Fundraising Platform, version 4.16.8.1. 43 lines.

- Page: https://pluginprobe.com/plugins/give/4.16.8.1/code/src/DonationForms/AsyncData/AsyncDataHelpers.php
- Raw: https://pluginprobe.com/plugins/give/4.16.8.1/raw/src/DonationForms/AsyncData/AsyncDataHelpers.php
- Modified: 2025-05-21T20:18:30+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/give/4.16.8.1/code/src/DonationForms/AsyncData/AsyncDataHelpers.php#L10-L20`.

```php
<?php

namespace Give\DonationForms\AsyncData;

use Give\DonationForms\DataTransferObjects\DonationFormGoalData;
use Give\DonationForms\V2\Models\DonationForm;
use Give\MultiFormGoals\ProgressBar\Model as ProgressBarModel;

/**
 * @since 3.16.0
 */
class AsyncDataHelpers
{
    /**
     * @since 3.16.0
     */
    public static function getFormDonationsCountValue($formId): int
    {
        return (new ProgressBarModel(['ids' => [$formId], 'statusList' => ['any']]))->getDonationCount();
    }

    /**
     * @since 4.2.0 return float value
     * @since 3.16.0
     */
    public static function getFormRevenueValue($formId): float
    {
        $donationForm = DonationForm::find($formId);
        $form = $donationForm->toV3Form();
        $goalData = new DonationFormGoalData($form->id, $form->settings);

        return $goalData->getCurrentAmount();
    }

    /**
     * @since 3.16.0
     */
    public static function getSkeletonPlaceholder($width = '100%', $height = '0.7rem'): string
    {
        return '<span class="give-skeleton js-give-async-data" style="width: ' . esc_attr($width) . '; height: ' . esc_attr($height) . ';"></span>';
    }
}

```
