Esempio n. 1
0
 /**
  * Return a new Mapper instance
  * 
  * @param  string       $entityClass 
  * @param  string       $entityMap
  * @return Mapper                     
  */
 public function make($entityClass, EntityMap $entityMap)
 {
     $driver = $entityMap->getDriver();
     $connection = $entityMap->getConnection();
     $adapter = $this->drivers->getAdapter($driver, $connection);
     $entityMap->setDateFormat($adapter->getDateFormat());
     $mapper = new Mapper($entityMap, $adapter, $this->dispatcher, $this->manager);
     // Fire Initializing Event
     $mapper->fireEvent('initializing', $mapper);
     $mapInitializer = new MapInitializer($entityMap);
     $mapInitializer->init();
     // Fire Initialized Event
     $mapper->fireEvent('initialized', $mapper);
     return $mapper;
 }