/** * @return void */ protected function initIndexes() { if ($this->indexes === NULL) { $this->initColumns(); $this->indexes = array(); foreach ($this->driver->getIndexes($this->name) as $info) { foreach ($info['columns'] as $key => $name) { $info['columns'][$key] = $this->columns[strtolower($name)]; } $this->indexes[strtolower($info['name'])] = new DibiIndexInfo($info); if (!empty($info['primary'])) { $this->primaryKey = $this->indexes[strtolower($info['name'])]; } } } }