I am about to write a little plugin for K2 what enables the user to link Items/categories to items/categories. The backend part is working and I would like to load the items/categories in
public function onK2PrepareContent(&$item, &$params, $limitstart) {}
I have tried to load an Item like that:
private function loadItem($iid)
{
if(!isset($this->itemCache[$iid]))
{
$oid = JRequest::getInt('id');
JRequest::setVar('id', $iid);
$item = $this->itemModel->getData();
$this->itemModel->prepareItem($item, 'item', '');
JRequest::setVar('id', $oid);
$this->itemCache[$iid] = $item;
}
return $this->itemCache[$iid];
}
But that throws some errors and seems not to work properly. Any Ideas I can load the Items and Category Objects?
Thanks in Ahead!