Exemple #1
0
 /**
  * @return void
  */
 protected function init()
 {
     if ($this->tables === NULL) {
         $this->tables = [];
         foreach ($this->reflector->getTables() as $info) {
             $this->tables[strtolower($info['name'])] = new Table($this->reflector, $info);
         }
     }
 }
Exemple #2
0
 /**
  * @return void
  */
 protected function initIndexes()
 {
     if ($this->indexes === NULL) {
         $this->initColumns();
         $this->indexes = [];
         foreach ($this->reflector->getIndexes($this->name) as $info) {
             foreach ($info['columns'] as $key => $name) {
                 $info['columns'][$key] = $this->columns[strtolower($name)];
             }
             $this->indexes[strtolower($info['name'])] = new Index($info);
             if (!empty($info['primary'])) {
                 $this->primaryKey = $this->indexes[strtolower($info['name'])];
             }
         }
     }
 }