File "DataCollectionOptionsBuilder.php"

Full Path: /home/capoeirajd/www/wp-content/plugins/wpforms-lite/vendor_prefixed/square/square/src/Models/Builders/DataCollectionOptionsBuilder.php
File size: 1.3 KB
MIME-type: text/x-php
Charset: utf-8

<?php

declare (strict_types=1);
namespace WPForms\Vendor\Square\Models\Builders;

use WPForms\Vendor\Core\Utils\CoreHelper;
use WPForms\Vendor\Square\Models\CollectedData;
use WPForms\Vendor\Square\Models\DataCollectionOptions;
/**
 * Builder for model DataCollectionOptions
 *
 * @see DataCollectionOptions
 */
class DataCollectionOptionsBuilder
{
    /**
     * @var DataCollectionOptions
     */
    private $instance;
    private function __construct(DataCollectionOptions $instance)
    {
        $this->instance = $instance;
    }
    /**
     * Initializes a new Data Collection Options Builder object.
     *
     * @param string $title
     * @param string $body
     * @param string $inputType
     */
    public static function init(string $title, string $body, string $inputType) : self
    {
        return new self(new DataCollectionOptions($title, $body, $inputType));
    }
    /**
     * Sets collected data field.
     *
     * @param CollectedData|null $value
     */
    public function collectedData(?CollectedData $value) : self
    {
        $this->instance->setCollectedData($value);
        return $this;
    }
    /**
     * Initializes a new Data Collection Options object.
     */
    public function build() : DataCollectionOptions
    {
        return CoreHelper::clone($this->instance);
    }
}