👁 查看:CollectedDataBuilder.php
路径:/home/forge/woocommerce-square/vendor/square/square/src/Models/Builders/CollectedDataBuilder.php
大小:963 B · 修改:2025-12-23 20:26:26 · 权限:0644 · 可写
<?php

declare(strict_types=1);

namespace Square\Models\Builders;

use Core\Utils\CoreHelper;
use Square\Models\CollectedData;

/**
 * Builder for model CollectedData
 *
 * @see CollectedData
 */
class CollectedDataBuilder
{
    /**
     * @var CollectedData
     */
    private $instance;

    private function __construct(CollectedData $instance)
    {
        $this->instance = $instance;
    }

    /**
     * Initializes a new Collected Data Builder object.
     */
    public static function init(): self
    {
        return new self(new CollectedData());
    }

    /**
     * Sets input text field.
     *
     * @param string|null $value
     */
    public function inputText(?string $value): self
    {
        $this->instance->setInputText($value);
        return $this;
    }

    /**
     * Initializes a new Collected Data object.
     */
    public function build(): CollectedData
    {
        return CoreHelper::clone($this->instance);
    }
}