예제 #1
0
파일: manager.php 프로젝트: boltphp/core
 public function __construct($config)
 {
     // set our source
     $this->_source = $config['source'];
     // handle
     $handle = $this->_source->getHandle();
     // configure
     $cfg = new Configuration();
     // set
     $cfg->setMetadataDriverImpl(new driver($this));
     $cfg->setProxyDir($config['tmp']);
     $cfg->setProxyNamespace('bolt\\model\\proxy');
     // create our entity manager
     $this->_em = EntityManager::create($handle, $cfg, $handle->getEventManager());
     // find all of our defined entities
     foreach (b::getClassExtends('\\bolt\\model\\entity') as $class) {
         $this->add($class->getConstant('NAME'), $class->name);
     }
 }