# give/4.16.8.1/src/Tracking/Helpers/FormBlocks.php

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

- Page: https://pluginprobe.com/plugins/give/4.16.8.1/code/src/Tracking/Helpers/FormBlocks.php
- Raw: https://pluginprobe.com/plugins/give/4.16.8.1/raw/src/Tracking/Helpers/FormBlocks.php
- Modified: 2024-05-01T19:40:26+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/Tracking/Helpers/FormBlocks.php#L10-L20`.

```php
<?php

namespace Give\Tracking\Helpers;

use Give\DonationForms\Models\DonationForm;

/**
 * @since 3.10.0
 */
class FormBlocks
{
    /**
     * @var DonationForm
     * @since 3.10.0
     */
    protected $form;

    /**
     * @since 3.10.0
     */
    public function __construct(DonationForm $form)
    {
        $this->form = $form;
    }

    /**
     * @since 3.10.0
     */
    public static function formId($formId): self
    {
        return new self(DonationForm::find($formId));
    }

    /**
     * @since 3.10.0
     */
    public function hasBlock(string $blockName): bool
    {
        return (bool) $this->form->blocks->findByName($blockName);
    }
}

```
