InventoryItem
+ Inheritance diagram for InventoryItem:

Description

An inventory item.

Inventory items cannot be deleted.

See also
https://shopify.dev/docs/admin-api/rest/reference/inventory/inventoryitem

Public Properties

const DIR = 'inventory_items'
 
const MAP
 
const TYPE = 'inventory_item'
 
- 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 number getCost ()
 
magic string getCountryCodeOfOrigin ()
 
magic CHSCode[] getCountryHarmonizedSystemCodes ()
 
magic string getCreatedAt ()
 
magic string getHarmonizedSystemCode ()
 
magic string getProvinceCodeOfOrigin ()
 
magic string getSku ()
 
magic string getUpdatedAt ()
 
magic bool isRequiresShipping ()
 
magic bool isTracked ()
 
CHSCode newCHSCode ()
 Factory. More...
 
magic $this setCost (number $cost)
 
magic $this setCountryCodeOfOrigin (string $code)
 
magic $this setCountryHarmonizedSystemCodes (CHSCode[] $codes)
 
magic $this setHarmonizedSystemCode (string $code)
 
magic $this setProvinceCodeOfOrigin (string $code)
 
magic $this setSku (string $sku)
 
magic $this setTracked (string $tracked)
 
- 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 UpdateTrait
$this update ()
 

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...
 
- Protected Methods inherited from CreateTrait
string _dir ()
 The POST directory. More...
 

Properties

◆ MAP

const MAP
Initial value:
= [
'country_harmonized_system_codes' => [CHSCode::class]
]

Methods

◆ getCost()

magic number getCost ( )
Returns
number

◆ getCountryCodeOfOrigin()

magic string getCountryCodeOfOrigin ( )
Returns
string

◆ getCountryHarmonizedSystemCodes()

magic CHSCode [] getCountryHarmonizedSystemCodes ( )
Returns
CHSCode[]

◆ getCreatedAt()

magic string getCreatedAt ( )
Returns
string

◆ getHarmonizedSystemCode()

magic string getHarmonizedSystemCode ( )
Returns
string

◆ getProvinceCodeOfOrigin()

magic string getProvinceCodeOfOrigin ( )
Depends:
canada-only
Returns
string

◆ getSku()

magic string getSku ( )
Returns
string

◆ getUpdatedAt()

magic string getUpdatedAt ( )
Returns
string

◆ isRequiresShipping()

magic bool isRequiresShipping ( )
Returns
bool

◆ isTracked()

magic bool isTracked ( )
Returns
bool

◆ newCHSCode()

CHSCode newCHSCode ( )

Factory.

Returns
CHSCode

◆ setCost()

magic $this setCost ( number  $cost)
Returns
$this

◆ setCountryCodeOfOrigin()

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

◆ setCountryHarmonizedSystemCodes()

magic $this setCountryHarmonizedSystemCodes ( CHSCode[]  $codes)
Returns
$this

◆ setHarmonizedSystemCode()

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

◆ setProvinceCodeOfOrigin()

magic $this setProvinceCodeOfOrigin ( string  $code)
Depends:
canada-only
Returns
$this

◆ setSku()

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

◆ setTracked()

magic $this setTracked ( string  $tracked)
Returns
$this