Variant
+ Inheritance diagram for Variant:

Description

Public Properties

const DIR = 'variants'
 
const MANAGED_BY_SHOPIFY = 'shopify'
 
const MAP
 
const POLICY_CONTINUE = 'continue'
 
const POLICY_DENY = 'deny'
 
const TYPE = 'variant'
 
- 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 string getBarcode ()
 
magic number getCompareAtPrice ()
 
magic string getCreatedAt ()
 
magic string getFulfillmentService ()
 
magic int getGrams ()
 
magic string getImageId ()
 
magic string getInventoryItemId ()
 
magic string getInventoryManagement ()
 
magic string getInventoryPolicy ()
 
magic int getInventoryQuantity ()
 
magic string getOption ()
 
magic int getPosition ()
 
magic Price[] getPresentmentPrices ()
 
magic number getPrice ()
 
Product getProduct ()
 
magic string getProductId ()
 injected More...
 
magic string getSku ()
 
magic string getTaxCode ()
 
magic string getTitle ()
 
magic string getUpdatedAt ()
 
magic int getWeight ()
 
magic string getWeightUnit ()
 
magic bool hasPresentmentPrices ()
 
magic bool isTaxable ()
 
magic Price[] selectPresentmentPrices (callable $filter)
 fn( Price $price ): bool More...
 
magic $this setBarcode (string $barcode)
 
magic $this setCompareAtPrice (number $price)
 
magic $this setCreatedAt (string $iso8601)
 
magic $this setFulfillmentService (string $service)
 
magic $this setGrams (int $grams)
 
magic $this setImageId (string $id)
 
magic $this setInventoryItemId (string $id)
 
magic $this setInventoryManagement (string $management)
 
magic $this setInventoryPolicy (string $policy)
 
magic $this setOption (string $option)
 
magic $this setPresentmentPrices (Price[] $prices)
 
magic $this setPrice (number $price)
 
magic $this setSku (string $sku)
 
magic $this setTaxable (bool $taxable)
 
magic $this setTaxCode (string $code)
 
magic $this setTitle (string $title)
 
magic $this setUpdatedAt (string $iso8601)
 
magic $this setWeight (int $weight)
 
magic $this setWeightUnit (string $unit)
 
- 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)
 
- Public Methods inherited from CreateTrait
$this create ()
 
- Public Methods inherited from DeleteTrait
void delete ()
 
- Public Methods inherited from UpdateTrait
$this update ()
 
- Public Methods inherited from MetafieldTrait
Metafield[] getMetafields ()
 
Metafield newMetafield ()
 Factory. More...
 

Protected Methods

 _container ()
 The container/owner object, if any. More...
 
string _metafieldType ()
 
- Protected Methods inherited from AbstractEntity
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...
 
- Protected Methods inherited from CreateTrait
string _dir ()
 The POST directory. More...
 

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=[])
 

Properties

◆ MAP

const MAP
Initial value:
= [
'presentment_prices' => [Price::class]
]

Methods

◆ _container()

_container ( )
protected

The container/owner object, if any.

Returns
null|AbstractEntity

Reimplemented from AbstractEntity.

◆ _metafieldType()

string _metafieldType ( )
finalprotected
Returns
string

Reimplemented from MetafieldTrait.

◆ getBarcode()

magic string getBarcode ( )
Returns
string

◆ getCompareAtPrice()

magic number getCompareAtPrice ( )
Returns
number

◆ getCreatedAt()

magic string getCreatedAt ( )
Returns
string

◆ getFulfillmentService()

magic string getFulfillmentService ( )
Returns
string

◆ getGrams()

magic int getGrams ( )
Returns
int

◆ getImageId()

magic string getImageId ( )
Returns
string

◆ getInventoryItemId()

magic string getInventoryItemId ( )
Returns
string

◆ getInventoryManagement()

magic string getInventoryManagement ( )
Returns
string

◆ getInventoryPolicy()

magic string getInventoryPolicy ( )
Returns
string

◆ getInventoryQuantity()

magic int getInventoryQuantity ( )
Returns
int

◆ getOption()

magic string getOption ( )
Returns
string

◆ getPosition()

magic int getPosition ( )
Returns
int

◆ getPresentmentPrices()

magic Price [] getPresentmentPrices ( )
Returns
Price[]

◆ getPrice()

magic number getPrice ( )
Returns
number

◆ getProduct()

Product getProduct ( )
Returns
Product

◆ getProductId()

magic string getProductId ( )

injected

Returns
string

◆ getSku()

magic string getSku ( )
Returns
string

◆ getTaxCode()

magic string getTaxCode ( )
Returns
string

◆ getTitle()

magic string getTitle ( )
Returns
string

◆ getUpdatedAt()

magic string getUpdatedAt ( )
Returns
string

◆ getWeight()

magic int getWeight ( )
Returns
int

◆ getWeightUnit()

magic string getWeightUnit ( )
Returns
string

◆ hasPresentmentPrices()

magic bool hasPresentmentPrices ( )
Returns
bool

◆ isTaxable()

magic bool isTaxable ( )
Returns
bool

◆ selectPresentmentPrices()

magic Price [] selectPresentmentPrices ( callable  $filter)

fn( Price $price ): bool

Returns
Price[]

◆ setBarcode()

magic $this setBarcode ( string  $barcode)
Returns
$this

◆ setCompareAtPrice()

magic $this setCompareAtPrice ( number  $price)
Returns
$this

◆ setCreatedAt()

magic $this setCreatedAt ( string  $iso8601)
Returns
$this

◆ setFulfillmentService()

magic $this setFulfillmentService ( string  $service)
Returns
$this

◆ setGrams()

magic $this setGrams ( int  $grams)
Returns
$this

◆ setImageId()

magic $this setImageId ( string  $id)
Returns
$this

◆ setInventoryItemId()

magic $this setInventoryItemId ( string  $id)
Returns
$this

◆ setInventoryManagement()

magic $this setInventoryManagement ( string  $management)
Returns
$this

◆ setInventoryPolicy()

magic $this setInventoryPolicy ( string  $policy)
Returns
$this

◆ setOption()

magic $this setOption ( string  $option)
Returns
$this

◆ setPresentmentPrices()

magic $this setPresentmentPrices ( Price[]  $prices)
Returns
$this

◆ setPrice()

magic $this setPrice ( number  $price)
Returns
$this

◆ setSku()

magic $this setSku ( string  $sku)
Returns
$this

◆ setTaxable()

magic $this setTaxable ( bool  $taxable)
Returns
$this

◆ setTaxCode()

magic $this setTaxCode ( string  $code)
Returns
$this

◆ setTitle()

magic $this setTitle ( string  $title)
Returns
$this

◆ setUpdatedAt()

magic $this setUpdatedAt ( string  $iso8601)
Returns
$this

◆ setWeight()

magic $this setWeight ( int  $weight)
Returns
$this

◆ setWeightUnit()

magic $this setWeightUnit ( string  $unit)
Returns
$this