<?php

abstract class AbstractFactoryTrackingMethod{

  public static function getInstance($code, $trackingObj = false){
    $tracking  = null ;
    require_once(DIR_SYSTEM . 'library/tracking/'.$code.'.php');
    if(class_exists(ucfirst($code))){
         switch ($code) {
             case Type_Tracking::Tp_Correios :
                $tracking = new Correios();
             break;
           case Type_Tracking::Tp_Kangu :
             $tracking = new KanguTracking($trackingObj);
             break;
             default:

             break;
         }
     return $tracking;
    }else{
        throw new Exception("Falha ao instanciar o módulo de rastreio: ".$code);
    }
 }

}

?>