ItemMixin

Source: FrameXML\ObjectAPI\Item.lua
==API==
* Item:CreateFromItemLocation(itemLocation) : item - Creates an object from an ItemLocation.
* Item:CreateFromBagAndSlot(bagID, slotIndex) : item - Creates an object from a bagID and slotIndex.
* Item:CreateFromEquipmentSlot(equipmentSlotIndex) : item - Creates an object from an inventorySlotId.
* Item:CreateFromItemLink(itemLink) : item - Creates an object from an ItemLink.
* Item:CreateFromItemID(itemID) : item - Creates an object from an item ID.
===Methods===
* ItemMixin:SetItemLocation(itemLocation)
* ItemMixin:SetItemLink(itemLink)
* ItemMixin:SetItemID(itemID)
* ItemMixin:GetItemLocation() : itemLocation
* ItemMixin:HasItemLocation() : boolean
* ItemMixin:Clear()
* ItemMixin:IsItemEmpty() : boolean
* ItemMixin:GetStaticBackingItem() : staticBackingItem
* ItemMixin:IsItemInPlayersControl() : boolean
* ItemMixin:GetItemID() : id
* ItemMixin:IsItemLocked() : boolean
* ItemMixin:LockItem()
* ItemMixin:UnlockItem()
* ItemMixin:GetItemIcon() : icon -- requires item data to be loaded
* ItemMixin:GetItemName() : name -- requires item data to be loaded
* ItemMixin:GetItemLink() : link -- requires item data to be loaded
* ItemMixin:GetItemQuality() : quality -- requires item data to be loaded
* ItemMixin:GetCurrentItemLevel() : level -- requires item data to be loaded
* ItemMixin:GetItemQualityColor() : qualityColor -- requires item data to be loaded
* ItemMixin:GetInventoryType() : inventoryType
* ItemMixin:GetItemGUID() : guid
* ItemMixin:GetInventoryTypeName() : inventoryTypeName
* ItemMixin:IsItemDataCached() : boolean
* ItemMixin:IsDataEvictable() : boolean
* ItemMixin:ContinueOnItemLoad(callbackFunction)
* ItemMixin:ContinueWithCancelOnItemLoad(callbackFunction) : cancelFunc
==ContinueOnItemLoad==
* Item information may not have been cached. You can use ItemMixin:ContinueOnItemLoad() to asynchronously query the data.
local item = Item:CreateFromItemID(21524)
item:ContinueOnItemLoad(function()
	local name = item:GetItemName() 
	local icon = item:GetItemIcon()
	print(name, icon) -- "Red Winter Hat", 133169
end)
 Certain items no longer return information from the server. For example itemID 17 still returns true for but will have success:false and will never return information.This will make :ContinueOnItemLoad never fire the callback. One workaround is to use :ContinueWithCancelOnItemLoad with a timeout or directly listen to ITEM_DATA_LOAD_RESULT.
==Patch changes==
==See also==
* ()
* 
* () ->