/** * Copy a subscription plan * @see OSModel::copy() */ function copy($id) { $copiedPlanId = parent::copy($id); //Insert data into renew options table $sql = 'INSERT INTO #__osmembership_renewrates(plan_id, number_days, price)' . " SELECT {$copiedPlanId}, number_days, price FROM #__osmembership_renewrates WHERE plan_id=" . $id; $this->_db->setQuery($sql); $this->_db->query(); return $copiedPlanId; }