public function read($sPkVal, $hFields = null) { if (empty($sPkVal)) { $this->log('read', "keine ID übergeben", false); return null; } if ('products' == $this->sTable) { $productData = cl6Plugin_plenigo::getProduct($sPkVal); if (!is_null($productData)) { return array('title' => $productData->getTitle(), 'description' => $productData->getDescription(), 'product_id' => $productData->getId(), 'subscription' => $productData->isSubscribable() ? 'on' : 'off', 'price' => intval($productData->getPrice()) * 100, 'type' => $productData->getType(), 'currency' => $productData->getCurrency()); } } elseif ('categories' == $this->sTable) { $categoryData = cl6Plugin_plenigo::getCategory($sPkVal); if (!is_null($categoryData)) { return array('title' => $categoryData->getTitle(), 'category_id' => $categoryData->getId(), 'price' => intval($categoryData->getPrice()) * 100, 'type' => $categoryData->getType(), 'currency' => $categoryData->getCurrency(), 'validity' => $categoryData->getValidityTime()); } } return null; }