Please don't use a string parameter to implement 3 different functions in one with switch/case. Separate the common functionality into a protected function, and then implement 3 functions which call it with the different data needed.