Library/Bullhorn/FastRest/Generator/ModelBuilder.php
private function buildIndexes() {
        $indexes = array();
        /** @var ResultSet $results */
        $results = $this->getConfiguration()->getConnection()->query('SHOW INDEX FROM `' . $this->getTableName() . '`');
        while($result = $results->fetch()) {
            $result = (object)$result;
            if(!array_key_exists($result->Key_name, $indexes)) {
                $indexes[$result->Key_name] = new Index();
            }
            /** @var Index $index */
            $index = $indexes[$result->Key_name];
            $index->setUnique(!$result->Non_unique);
            $index->addColumn($result->Column_name);
            $index->setPrimary($result->Key_name == 'PRIMARY');
        }
        $this->setIndexes($indexes);
    }
private function buildIndexes() {
        $indexes = array();
        /** @var ResultSet $results */
        $results = $this->getConfiguration()->getConnection()->query('SHOW INDEX FROM `' . $this->getTableName() . '`');
        while($result = $results->fetch()) {
            $result = (object)$result;
            if(!array_key_exists($result->Key_name, $indexes)) {
                $indexes[$result->Key_name] = new Index();
            }
            /** @var Index $index */
            $index = $indexes[$result->Key_name];
            $index->setUnique(!$result->Non_unique);
            $index->addColumn($result->Column_name);
            $index->setPrimary($result->Key_name == 'PRIMARY');
        }
        $this->setIndexes($indexes);
    }
private function buildIndexes ( ) { $ indexes = array ( ) ; /** @var ResultSet $results */ $ results = $ this -> getConfiguration ( ) -> getConnection ( ) -> query ( 'SHOW INDEX FROM `' . $ this -> getTableName ( ) . '`' ) ; while ( $ result = $ results -> fetch ( ) ) { $ result = ( object ) $ result ; if ( ! array_key_exists ( $ result -> Key_name , $ indexes ) ) { $ indexes [ $ result -> Key_name ] = new Index ( ) ; } /** @var Index $index */ $ index = $ indexes [ $ result -> Key_name ] ; $ index -> setUnique ( ! $ result -> Non_unique ) ; $ index -> addColumn ( $ result -> Column_name ) ; $ index -> setPrimary ( $ result -> Key_name == 'PRIMARY' ) ; } $ this -> setIndexes ( $ indexes ) ; }
Builds the indexes
@return void
Builds the indexes