A price rule.
Public Properties | |
const | ALLOCATE_ACROSS = 'across' |
const | ALLOCATE_EACH = 'each' |
const | CUSTOMER_SELECT_ALL = 'all' |
const | CUSTOMER_SELECT_CONDITION = 'prerequisite' |
const | DIR = 'price_rules' |
const | MAP |
const | TARGET_SELECT_ALL = 'all' |
const | TARGET_SELECT_ENTITLED = 'entitled' |
const | TARGET_TYPE_LINE_ITEM = 'line_item' |
const | TARGET_TYPE_SHIPPING_LINE = 'shipping_line' |
const | TYPE = 'price_rule' |
const | VALUE_FIXED = 'fixed' |
const | VALUE_PERCENT = 'percentage' |
Public Properties inherited from AbstractEntity | |
const | DIR = '' |
All subclasses must redeclare this to match their REST directory (without container). More... | |
const | TYPE = '' |
All subclasses must redeclare this to match their types. More... | |
Public Properties inherited from Data | |
const | MAP = [] |
const | PATCH = [] |
Public Methods | |
magic int | getAllocationLimit () |
magic string | getAllocationMethod () |
see the constants More... | |
magic string | getCreatedAt () |
magic string | getCustomerSelection () |
see the constants More... | |
DiscountCode[] | getDiscountCodes () |
magic string | getEndsAt () |
magic string[] | getEntitledCollectionIds () |
magic string[] | getEntitledCountryIds () |
magic string[] | getEntitledProductIds () |
magic string[] | getEntitledVariantIds () |
null number | getMaxShipping () |
null int | getMinQuantity () |
null number | getMinSubtotal () |
magic string[] | getPrerequisiteCollectionIds () |
magic string[] | getPrerequisiteCustomerIds () |
magic string[] | getPrerequisiteProductIds () |
magic string[] | getPrerequisiteSavedSearchIds () |
magic string[] | getPrerequisiteVariantIds () |
magic string | getStartsAt () |
magic string | getTargetSelection () |
see the constants More... | |
magic string | getTargetType () |
see the constants More... | |
magic string | getTitle () |
magic string | getUpdatedAt () |
magic string | getUsageLimit () |
magic int | getValue () |
magic string | getValueType () |
magic bool | hasEntitledCollectionIds () |
magic bool | hasEntitledCountryIds () |
magic bool | hasEntitledProductIds () |
magic bool | hasEntitledVariantIds () |
magic bool | hasPrerequisiteCollectionIds () |
magic bool | hasPrerequisiteCustomerIds () |
magic bool | hasPrerequisiteProductIds () |
magic bool | hasPrerequisiteSavedSearchIds () |
magic bool | hasPrerequisiteVariantIds () |
magic bool | isOncePerCustomer () |
DiscountCode | newDiscountCode () |
magic $this | setAllocationLimit (int $limit) |
magic $this | setAllocationMethod (string $method) |
see the constants More... | |
magic $this | setCustomerSelection (string $selection) |
see the constants More... | |
magic $this | setEndsAt (string $iso8601) |
magic $this | setEntitledCollectionIds (string[] $ids) |
magic $this | setEntitledCountryIds (string[] $ids) |
magic $this | setEntitledProductIds (string[] $ids) |
magic $this | setEntitledVariantIds (string[] $ids) |
$this | setMaxShipping ($max) |
$this | setMinQuantity (?int $min) |
$this | setMinSubtotal ($min) |
magic $this | setOncePerCustomer (bool $once) |
magic $this | setPrerequisiteCollectionIds (string[] $ids) |
magic $this | setPrerequisiteCustomerIds (string[] $ids) |
magic $this | setPrerequisiteProductIds (string[] $ids) |
magic $this | setPrerequisiteSavedSearchIds (string[] $ids) |
magic $this | setPrerequisiteVariantIds (string[] $ids) |
magic $this | setStartsAt (string $iso8601) |
magic $this | setTargetSelection (string $selection) |
see the constants More... | |
magic $this | setTargetType (string $type) |
see the constants More... | |
magic $this | setTitle (string $title) |
magic $this | setUsageLimit (string $limit) |
magic $this | setValue (int $value) |
negative More... | |
magic $this | setValueType (string $type) |
Public Methods inherited from AbstractEntity | |
string | __toString () |
null string | getId () |
string[] | getPoolKeys () |
bool | hasId () |
$this | reload () |
Fully reloads the entity from Shopify. More... | |
Public Methods inherited from Data | |
mixed | __call (string $method, array $args) |
__construct ($caller, array $data=[]) | |
string | serialize () |
Dehydrated JSON encode. More... | |
array | toArray () |
void | unserialize ($serialized) |
Additional Inherited Members | |
Protected Properties inherited from Data | |
Api | $api |
Pool | $pool |
Public Static Methods inherited from AbstractEntity | |
static null self | load ($caller, string $id, array $query=[]) |
static self[] | loadAll ($caller, string $path, array $query=[]) |
Protected Methods inherited from AbstractEntity | |
null AbstractEntity | _container () |
The container/owner object, if any. More... | |
mixed | _get (string $field) |
Lazy-loads missing fields. More... | |
void | _onDelete () |
void | _onSave () |
void | _reload (string $field) |
Protected Methods inherited from Data | |
mixed | _hydrate (string $class, $item) |
A factory that also hydrates / caches entities. More... | |
array | _select ($subject, callable $filter,... $args) |
Magic method: selectField(callable $filter) More... | |
$this | _setData (array $data) |
Clears all diffs and sets all data, hydrating mapped fields. More... | |
$this | _setField (string $field, $value) |
Sets a value, hydrating if mapped, and clears the diff. More... | |
const MAP |
magic int getAllocationLimit | ( | ) |
magic string getAllocationMethod | ( | ) |
see the constants
magic string getCreatedAt | ( | ) |
magic string getCustomerSelection | ( | ) |
see the constants
DiscountCode [] getDiscountCodes | ( | ) |
magic string getEndsAt | ( | ) |
magic string [] getEntitledCollectionIds | ( | ) |
magic string [] getEntitledCountryIds | ( | ) |
magic string [] getEntitledProductIds | ( | ) |
magic string [] getEntitledVariantIds | ( | ) |
null number getMaxShipping | ( | ) |
null int getMinQuantity | ( | ) |
null number getMinSubtotal | ( | ) |
magic string [] getPrerequisiteCollectionIds | ( | ) |
magic string [] getPrerequisiteCustomerIds | ( | ) |
magic string [] getPrerequisiteProductIds | ( | ) |
magic string [] getPrerequisiteSavedSearchIds | ( | ) |
magic string [] getPrerequisiteVariantIds | ( | ) |
magic string getStartsAt | ( | ) |
magic string getTargetSelection | ( | ) |
see the constants
magic string getTargetType | ( | ) |
see the constants
magic string getTitle | ( | ) |
magic string getUpdatedAt | ( | ) |
magic string getUsageLimit | ( | ) |
magic int getValue | ( | ) |
magic string getValueType | ( | ) |
magic bool hasEntitledCollectionIds | ( | ) |
magic bool hasEntitledCountryIds | ( | ) |
magic bool hasEntitledProductIds | ( | ) |
magic bool hasEntitledVariantIds | ( | ) |
magic bool hasPrerequisiteCollectionIds | ( | ) |
magic bool hasPrerequisiteCustomerIds | ( | ) |
magic bool hasPrerequisiteProductIds | ( | ) |
magic bool hasPrerequisiteSavedSearchIds | ( | ) |
magic bool hasPrerequisiteVariantIds | ( | ) |
magic bool isOncePerCustomer | ( | ) |
DiscountCode newDiscountCode | ( | ) |
magic $this setAllocationLimit | ( | int | $limit | ) |
magic $this setAllocationMethod | ( | string | $method | ) |
see the constants
magic $this setCustomerSelection | ( | string | $selection | ) |
see the constants
magic $this setEndsAt | ( | string | $iso8601 | ) |
magic $this setEntitledCollectionIds | ( | string[] | $ids | ) |
magic $this setEntitledCountryIds | ( | string[] | $ids | ) |
magic $this setEntitledProductIds | ( | string[] | $ids | ) |
magic $this setEntitledVariantIds | ( | string[] | $ids | ) |
$this setMaxShipping | ( | $max | ) |
null | number | $max |
$this setMinQuantity | ( | ?int | $min | ) |
null | int | $min |
$this setMinSubtotal | ( | $min | ) |
null | number | $min |
magic $this setOncePerCustomer | ( | bool | $once | ) |
magic $this setPrerequisiteCollectionIds | ( | string[] | $ids | ) |
magic $this setPrerequisiteCustomerIds | ( | string[] | $ids | ) |
magic $this setPrerequisiteProductIds | ( | string[] | $ids | ) |
magic $this setPrerequisiteSavedSearchIds | ( | string[] | $ids | ) |
magic $this setPrerequisiteVariantIds | ( | string[] | $ids | ) |
magic $this setStartsAt | ( | string | $iso8601 | ) |
magic $this setTargetSelection | ( | string | $selection | ) |
see the constants
magic $this setTargetType | ( | string | $type | ) |
see the constants
magic $this setTitle | ( | string | $title | ) |
magic $this setUsageLimit | ( | string | $limit | ) |
magic $this setValue | ( | int | $value | ) |
negative
magic $this setValueType | ( | string | $type | ) |