Get the index data about items' positions

@return array
427489
public function getIndexData() {
		if ($this->index === null) {
			$currentPointer = ftell($this->file);
			fseek($this->file, 0);
			
			$count       = 0;
			$this->index = [];
			
			while (fgets($this->file) !== false) {
				$this->index[++ $count] = ftell($this->file);
			}

			fseek($this->file, $currentPointer);
		}
		
		return $this->index;
	}
1037848
public function getContentAsArray()
    {
        //$nav_item_page = (new \yii\db\Query())->select('*')->from('cms_nav_item_page t1')->leftJoin('cms_layout', 'cms_layout.id=t1.layout_id')->where(['t1.id' => $this->id])->one();
        $nav_item_page = $this;
        
        if (!$nav_item_page->layout) {
            return [];
        }
        
        $return = [
            'nav_item_page' => ['id' => $nav_item_page->id, 'layout_id' => $nav_item_page->layout_id, 'layout_name' => $nav_item_page->layout->name],
            '__placeholders' => [],
        ];
        
        $config = json_decode($nav_item_page->layout->json_config, true);
        
        if (isset($config['placeholders'])) {
            foreach ($config['placeholders'] as $rowKey => $row) {
                foreach ($row as $placeholderKey => $placeholder) {
                    $placeholder['nav_item_page_id'] = $this->id;
                    $placeholder['prev_id'] = 0;
                    $placeholder['__nav_item_page_block_items'] = [];
                    if (!isset($placeholder['cols'])) {
                        $placeholder['cols'] = '12';
                    }
                    
                    $return['__placeholders'][$rowKey][$placeholderKey] = $placeholder;
                    
                    $placeholderVar = $placeholder['var'];
                    
                    $return['__placeholders'][$rowKey][$placeholderKey]['__nav_item_page_block_items'] = self::getPlaceholder($placeholderVar, 0, $this);
                }
            }
        }
        
        return $return;
    }
98989
public function getData()
    {
        $result = [
            'title' => $this->title,
            'subtitle' => $this->subtitle,
            'item_url' => $this->url,
            'image_url' => $this->image_url,
        ];
        
        if (!empty($this->default_action)) {
            $result['default_action'] = $this->default_action;
        }

        if (!empty($this->buttons)) {
            $result['buttons'] = [];

            foreach ($this->buttons as $btn) {
                $result['buttons'][] = $btn->getData();
            }
        }

        return $result;
    }
142016
public function index()
    {
        return $this->render('index', [
            'pages' => $this->model->getNavItemPageBlockItems()->select(['nav_item_page_id'])->distinct()->orderBy([])->all(),
        ]);
    }
309673
public function getData()
    {
        if (is_null($this->data)) {
            $this->data = $this->index->getParser()->getData($this->getOffset());
            
        }
        return $this->data;
    }
320680
private function getItemsWithOneExtra()
    {
        if (null === $this->itemsWithOneExtra) {
            $this->itemsWithOneExtra = $this
                ->adapter
                ->getItems($this->getOffset(), $this->getLength() + 1)
            ;
        }

        return $this->itemsWithOneExtra;
    }
1051746
protected function _getAllIndices()
    {
        $out = array();

        foreach ($this->_thread as $val) {
            $out += $val;
        }

        return array_keys($out);
    }
152910
protected function getIndex()
	{
		if (!$this->index) {
			$this->index = $this->getClient()->initIndex($this->name);
		}
		
		return $this->index;
	}
342412
public function getIndices(): array
    {
        $indices = [];
        foreach ($this->_data['indices'] as $indexName => $index) {
            $indices[$indexName] = new Index($indexName, $index);
        }

        return $indices;
    }
60381
public function getIndexes()
    {
        $query = $this->db->getQuery(true);
        $table = $this->db->replacePrefix($this->name);

        $query->select([
            'tbl.name AS table_name',
            'col.name AS column_name',
            'idx.name AS index_name',
            'col.*',
            'idx.*'
        ])
            ->from('sys.columns AS col')
            ->leftJoin(
                'sys.tables AS tbl',
                'col.object_id = tbl.object_id'
            )
            ->leftJoin(
                'sys.index_columns AS ic',
                'col.column_id = ic.column_id AND ic.object_id = tbl.object_id'
            )
            ->leftJoin(
                'sys.indexes AS idx',
                'idx.object_id = tbl.object_id AND idx.index_id = ic.index_id'
            )
            ->where('tbl.name = %q', $table)

            ->where('(idx.name IS NOT NULL OR col.is_identity = 1 OR idx.is_primary_key = 1)');

        $indexes = $this->db->prepare($query)->loadAll();

        $keys = [];

        foreach ($indexes as $index) {
            $key = new \stdClass();

            $key->Table = $table;
            $key->Is_primary = $index->is_primary_key ?: $index->is_identity;
            $key->Non_unique = !$index->is_unique;
            $key->Key_name = $key->Is_primary ? 'PRIMARY' : $index->index_name;
            $key->Column_name = $index->column_name;
            $key->Collation = 'A';
            $key->Cardinality = 0;
            $key->Sub_part = null;
            $key->Packed = null;
            $key->Null = null;
            $key->Index_type = 'BTREE';
            // TODO: Finish comments query
            $key->Comment = null;
            $key->Index_comment = null;
            $key->is_identity = $index->is_identity ? 'auto_increment' : '';

            $keys[] = $key;
        }

        return $keys;
    }
939682
public function getItems()
    {
        if (count($this->items) > $this->itemsPerPage) {
            $items = [];
            $counter = 0;
            foreach ($this->items as $key => $value) {
                $items[$key] = $value;
                $counter++;
                if ($counter == $this->itemsPerPage) {
                    return $items;
                }
            }
        }

        return $this->items;
    }
1220583
public function getIndices(): array
    {
        $appId = $this->getAppKey();

        $result = [];
        foreach ($this->indices as $index => $_) {
            if (false !== preg_match("/(?P<app_id>[^_]+)\_(?P<id>[\S]+)/", $index, $matches)) {
                if (!empty($appId) && $matches['app_id'] !== $appId) {
                    continue;
                }

                $indexMeta = [
                    'uuid' => ['id' => $matches['id']],
                    'app_id' => ['id' => $matches['app_id']],
                    'doc_count' => 0,
                ];

                $result[] = Index::createFromArray($indexMeta);
            }
        }

        return $result;
    }
704790
def _get_item_position(self, idx):
        """"""
        start = 0 if idx == 0 else self._index[idx - 1] + 1
        end = self._index[idx]
        return start, end
312747
protected function _getList()
    {
        $data = array();

        if ($items = $this->_state->getList()) {
            $name = AnInflector::singularize($this->getName());

            foreach ($items as $item) {
                $this->_state->setItem($item);
                $name = null;
                $item = $this->_serializeToArray($item, $name);

                if (count($commands = $this->getToolbarCommands('list'))) {
                    $item['commands'] = $commands;
                }

                $data[] = $item;
            }

            $data = array(
                'data' => $data,
            );
            
            if (is($items, 'AnDomainEntitysetAbstract')) {
                $data['pagination'] = array(
                    'offset' => (int) $items->getOffset(),
                    'limit' => (int) $items->getLimit(),
                    'total' => (int) $items->getTotal(),
                );
            }
        }

        return $data;
    }
913723
protected function buildIndex(): array
    {
        $path = $this->getStoragePath();
        if (!file_exists($path)) {
            return [];
        }

        if ($this->prefixed) {
            $list = $this->buildPrefixedIndexFromFilesystem($path);
        } else {
            $list = $this->buildIndexFromFilesystem($path);
        }

        ksort($list, SORT_NATURAL);

        return $list;
    }
523776
public function getLeftItems()
    {
        // Transform the items into the two sides
        if (empty($this->leftItems) && empty($this->rightItems)) {
            $this->transformItems();
        }
        
        return $this->leftItems;
    }
427821
public function getItems(): array
    {
        $available = [];
        $assigned = [];

        foreach (array_keys($this->manager->getRoles()) as $name) {
            $available[$name] = 'role';
        }

        foreach (array_keys($this->manager->getPermissions()) as $name) {
            if ($name[0] != '/') {
                $available[$name] = 'permission';
            }
        }

        foreach ($this->manager->getAssignments($this->userId) as $item) {
            $assigned[$item->roleName] = $available[$item->roleName];
            unset($available[$item->roleName]);
        }

        return [
            'available' => $available,
            'assigned' => $assigned,
        ];
    }