👁 查看:CashDrawerDeviceBuilder.php
路径:/home/forge/woocommerce-square/vendor/square/square/src/Models/Builders/CashDrawerDeviceBuilder.php
大小:1.3 KB · 修改:2025-12-23 20:26:26 · 权限:0644 · 可写
<?php
declare(strict_types=1);
namespace Square\Models\Builders;
use Core\Utils\CoreHelper;
use Square\Models\CashDrawerDevice;
/**
* Builder for model CashDrawerDevice
*
* @see CashDrawerDevice
*/
class CashDrawerDeviceBuilder
{
/**
* @var CashDrawerDevice
*/
private $instance;
private function __construct(CashDrawerDevice $instance)
{
$this->instance = $instance;
}
/**
* Initializes a new Cash Drawer Device Builder object.
*/
public static function init(): self
{
return new self(new CashDrawerDevice());
}
/**
* Sets id field.
*
* @param string|null $value
*/
public function id(?string $value): self
{
$this->instance->setId($value);
return $this;
}
/**
* Sets name field.
*
* @param string|null $value
*/
public function name(?string $value): self
{
$this->instance->setName($value);
return $this;
}
/**
* Unsets name field.
*/
public function unsetName(): self
{
$this->instance->unsetName();
return $this;
}
/**
* Initializes a new Cash Drawer Device object.
*/
public function build(): CashDrawerDevice
{
return CoreHelper::clone($this->instance);
}
}