Updated depricated API

'$this->item->type' is no longer available in the API. I recommend using '$item-type' instead.