Exemplo n.º 1
0
 /**
  * Constructor
  * 
  * @param ProviderInterface $pkg
  * @param boolean $useDefaultSettings  if it's set to false, no default 
  *                                      mapping information will be added to 
  *                                      the drivers array
  */
 public function __construct(ProviderInterface $pkg, $useDefaultSettings = true)
 {
     if ($useDefaultSettings) {
         $defaultNamespace = $pkg->getNamespace() . '\\Entity';
         $mappingDataPath = $pkg->getPackagePath() . DIRECTORY_SEPARATOR . DIRNAME_CONFIG . DIRECTORY_SEPARATOR . DIRNAME_METADATA_XML;
         $this->addDriver($defaultNamespace, $mappingDataPath);
     }
 }
 public function addProvider(ProviderInterface $provider)
 {
     foreach ($provider->getDrivers() as $driver) {
         $this->addDriver($driver);
     }
 }