Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
forbidals
/
wp-content
/
plugins
/
wpforms-lite
/
vendor_prefixed
/
square
/
square
/
src
/
Models
:
LoyaltyProgramAccrualRuleItemVariationData.php
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
<?php declare (strict_types=1); namespace WPForms\Vendor\Square\Models; use stdClass; /** * Represents additional data for rules with the `ITEM_VARIATION` accrual type. */ class LoyaltyProgramAccrualRuleItemVariationData implements \JsonSerializable { /** * @var string */ private $itemVariationId; /** * @param string $itemVariationId */ public function __construct(string $itemVariationId) { $this->itemVariationId = $itemVariationId; } /** * Returns Item Variation Id. * The ID of the `ITEM_VARIATION` [catalog object](entity:CatalogObject) that buyers can purchase to * earn * points. */ public function getItemVariationId() : string { return $this->itemVariationId; } /** * Sets Item Variation Id. * The ID of the `ITEM_VARIATION` [catalog object](entity:CatalogObject) that buyers can purchase to * earn * points. * * @required * @maps item_variation_id */ public function setItemVariationId(string $itemVariationId) : void { $this->itemVariationId = $itemVariationId; } /** * Encode this object to JSON * * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields * are set. (default: false) * * @return array|stdClass */ #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = \false) { $json = []; $json['item_variation_id'] = $this->itemVariationId; $json = \array_filter($json, function ($val) { return $val !== null; }); return !$asArrayWhenEmpty && empty($json) ? new stdClass() : $json; } }