public function copy() { if (isset($this->params["id"])) { return MealPlanComponent::copyWithinMealPlan($this->params["id"]); } else { throw new Exception('Missing id parameter'); } }