/** * Get mapper instance * * @return ProtoAbstractMapper|MongoAbstractMapper */ public function getMapper($type = null) { if (!$type) { return parent::getMapper(); } // Call mapper static method switch (strtolower($type)) { case self::TYPE_LIFECYCLE: return \Application\Model\Mapper\TariffPlanLifeCycleMapper::getInstance(); break; case self::TYPE_SERVICES: return \Application\Model\Mapper\TariffPlanServicesMapper::getInstance(); break; default: throw new AppEx\InvalidArgumentException("Invalid Type given"); } }