예제 #1
0
파일: Database.php 프로젝트: janlanger/dibi
 /**
  * @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);
         }
     }
 }
예제 #2
0
파일: Table.php 프로젝트: janlanger/dibi
 /**
  * @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'])];
             }
         }
     }
 }