👁 查看:OrderLineItemTaxBuilder.php
路径:/home/forge/woocommerce-square/vendor/square/square/src/Models/Builders/OrderLineItemTaxBuilder.php
大小:3.9 KB · 修改:2025-12-23 20:26:26 · 权限:0644 · 可写
<?php
declare(strict_types=1);
namespace Square\Models\Builders;
use Core\Utils\CoreHelper;
use Square\Models\Money;
use Square\Models\OrderLineItemTax;
/**
* Builder for model OrderLineItemTax
*
* @see OrderLineItemTax
*/
class OrderLineItemTaxBuilder
{
/**
* @var OrderLineItemTax
*/
private $instance;
private function __construct(OrderLineItemTax $instance)
{
$this->instance = $instance;
}
/**
* Initializes a new Order Line Item Tax Builder object.
*/
public static function init(): self
{
return new self(new OrderLineItemTax());
}
/**
* Sets uid field.
*
* @param string|null $value
*/
public function uid(?string $value): self
{
$this->instance->setUid($value);
return $this;
}
/**
* Unsets uid field.
*/
public function unsetUid(): self
{
$this->instance->unsetUid();
return $this;
}
/**
* Sets catalog object id field.
*
* @param string|null $value
*/
public function catalogObjectId(?string $value): self
{
$this->instance->setCatalogObjectId($value);
return $this;
}
/**
* Unsets catalog object id field.
*/
public function unsetCatalogObjectId(): self
{
$this->instance->unsetCatalogObjectId();
return $this;
}
/**
* Sets catalog version field.
*
* @param int|null $value
*/
public function catalogVersion(?int $value): self
{
$this->instance->setCatalogVersion($value);
return $this;
}
/**
* Unsets catalog version field.
*/
public function unsetCatalogVersion(): self
{
$this->instance->unsetCatalogVersion();
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;
}
/**
* Sets type field.
*
* @param string|null $value
*/
public function type(?string $value): self
{
$this->instance->setType($value);
return $this;
}
/**
* Sets percentage field.
*
* @param string|null $value
*/
public function percentage(?string $value): self
{
$this->instance->setPercentage($value);
return $this;
}
/**
* Unsets percentage field.
*/
public function unsetPercentage(): self
{
$this->instance->unsetPercentage();
return $this;
}
/**
* Sets metadata field.
*
* @param array<string,string>|null $value
*/
public function metadata(?array $value): self
{
$this->instance->setMetadata($value);
return $this;
}
/**
* Unsets metadata field.
*/
public function unsetMetadata(): self
{
$this->instance->unsetMetadata();
return $this;
}
/**
* Sets applied money field.
*
* @param Money|null $value
*/
public function appliedMoney(?Money $value): self
{
$this->instance->setAppliedMoney($value);
return $this;
}
/**
* Sets scope field.
*
* @param string|null $value
*/
public function scope(?string $value): self
{
$this->instance->setScope($value);
return $this;
}
/**
* Sets auto applied field.
*
* @param bool|null $value
*/
public function autoApplied(?bool $value): self
{
$this->instance->setAutoApplied($value);
return $this;
}
/**
* Initializes a new Order Line Item Tax object.
*/
public function build(): OrderLineItemTax
{
return CoreHelper::clone($this->instance);
}
}