Esempio n. 1
0
 public function getTable()
 {
     if (!$this->table) {
         $original = $this->mapper->getTableByRepositoryClass(get_called_class());
         if (!$this->module) {
             $this->table = self::CORE_TABLE_PREFIX . '__' . $original;
         } else {
             $this->table = $this->module->getVendor() . '_' . $this->module->getName() . '__' . $original;
         }
     }
     return $this->table;
 }
Esempio n. 2
0
 /**
  * @param IModule $module
  * @return $this
  */
 public function addModule(IModule $module)
 {
     $this->modules[$name = $module->getName() . '/' . $module->getVendor()] = $module;
     $this->eventManager->call('phoenix.modules.init', $name, $module);
     return $this;
 }
Esempio n. 3
0
 /**
  * @param  IModule $module
  * @throws InvalidMappingException
  */
 protected function addModuleMapping(IModule $module)
 {
     $config = $module->getConfig();
     if (isset($config['database']) && isset($config['database']['mapping'])) {
         $mapping = $config['database']['mapping'];
         if (is_array($mapping)) {
             foreach ($mapping as $key => $value) {
                 $this->addEntityMapping($key, $value);
             }
         }
     }
 }