Scalr\Model\AbstractEntity::_fetchIndexes PHP Method

_fetchIndexes() private method

Retrieves show indexes info and stores it in the cache
private _fetchIndexes ( )
    private function _fetchIndexes()
    {
        $class = get_class($this);
        if (!isset(self::$cache[$class]['show_index'])) {
            //Cols: Table, Non_unique, Key_name, Seq_in_index, Column_name, Collation, Cardinality, Sub_part,
            //      Packed, Null, Index_type, Comment, Index_comment
            self::$cache[$class]['show_index'] = $this->db()->GetAll("SHOW INDEX FROM " . $this->table());
            //Whether table has any unique key
            self::$cache[$class]['has_unique'] = false;
            foreach (self::$cache[$class]['show_index'] as $v) {
                if (!$v['Non_unique'] && $v['Key_name'] !== 'PRIMARY') {
                    self::$cache[$class]['has_unique'] = true;
                    break;
                }
            }
        }
    }