get categories from a page

@see https://www.mediawiki.org/wiki/API:Categories
@return array
166731
public function getCategoryfromPage()
    {
        $this->logger->debug('Category:getCategoryfromPage');
        if (!$this->setIdentifier('', 's')) {
            return [];
        }
        $this->setGeneratorCategories();
        return $this->getCategoryinfoResponse();
    }
196336
public function getAllRequestClasses(): array
    {
        $allRequestClasses = [];

        foreach ($this->getDomainNames() as $domainName) {
            foreach ($this->getSectionNames($domainName) as $sectionName) {
                foreach ($this->getCategoryNames($domainName, $sectionName) as $categoryName) {
                    foreach ($this->getFqcnRequestNames($domainName, $sectionName, $categoryName) as $fqcnRequestName) {
                        $allRequestClasses[] = $fqcnRequestName;
                    }
                }
            }
        }

        return $allRequestClasses;
    }
59844
public function getCategoryIds()
    {
        return array_keys((new CmsCategoryRelationQuery)
                ->join('cms_category')->on('cms_category_id')
                ->whereObject()->equals($this->_object)
                ->andFieldObjectId()->equals($this->_objectId)
                ->findPairs('cms_category.id', 'cms_category.id'));
    }
433447
protected function getProcessedCategoryIds()
    {
        $categoryIds = [];
        $source = $this->getSource();

        $source->rewind();
        while ($source->valid()) {
            $current = $source->current();
            if (isset($this->newCategory[$current[self::COL_ROOT]][$current[self::COL_CATEGORY]])) {
                $categoryIds[] = $this->newCategory[$current[self::COL_ROOT]][$current[self::COL_CATEGORY]];
            } elseif (isset($this->categoriesWithRoots[$current[self::COL_ROOT]][$current[self::COL_CATEGORY]])) {
                $categoryIds[] = $this->categoriesWithRoots[$current[self::COL_ROOT]][$current[self::COL_CATEGORY]];
            }

            $source->next();
        }

        return $categoryIds;
    }
439642
protected function getChildrenCategories()
    {
        if ($this->childrenCategories === null) {
            $currentCategory = $this->dataProvider->getCategory();
            $this->childrenCategories = $currentCategory->getChildrenCategories();
        }

        return $this->childrenCategories;
    }
74568
public static function findAll($page_request = null)
    {
        if($page_request != null){
            return self::listAllCategories(['page' => $page_request->getPageNumber(), 'size' => $page_request->getSize() ]);
        }else {
            return self::listAllCategories();
        }
    }
354070
protected function _getCategoryList()
    {
        if ($this->_oCatList == null) {
            $this->_oCatList = oxNew(\OxidEsales\Eshop\Application\Model\CategoryList::class);
            $this->_oCatList->updateCategoryTree(false);
        }

        return $this->_oCatList;
    }
37429
public Category getCategory(int pageId) {
        long hibernateId = __getCategoryHibernateId(pageId);
        if (hibernateId == -1) {
            return null;
        }

        try {
            Category cat = new Category(this, hibernateId);
            return cat;
        } catch (WikiPageNotFoundException e) {
            return null;
        }
    }
465107
public function load_item_category() {
        if (empty($this->item_category->id)) {
            $this->item_category = $this->get_item_category();
        }
        return $this->item_category;
    }
1285205
public function get_category_list()
    {
        $cat = [];
        $url_cat = sprintf('%s?hl=%s', self::CATEGORY_URL, $this->get_locale());

        if (false === $cxml = simplexml_load_file($url_cat)) {
            throw new Bridge_Exception_ApiConnectorRequestFailed('Failed to retrive youtube categories');
        }

        $cxml->registerXPathNamespace('atom', 'http://www.w3.org/2005/Atom');
        $categories = $cxml->xpath('//atom:category');

        foreach ($categories as $c) {
            $cat[(string) $c['term']] = (string) $c['label'];
        }

        return $cat;
    }
221649
public function getCategory($key)
    {
        return array_key_exists($key, $this->_categories) ? $this->_categories[$key] : null;
    }
471880
public function getAll()
    {
        return array_merge(
            [
                'id'       => $this->getUrlParser()->getId(),
                'category' => $this->getUrlParser()->getCategory(),
            ],
            $this->getPictures(),
            $this->getProperties(),
            $this->getDescription()
        );
    }
559935
public function getRootCategories()
    {
        $rootCategories = [];
        foreach ($this->categories as $categories) {
            if ($categories->getLvl() == 0) {
                $rootCategories[] = $categories;
            }
        }

        return $rootCategories;
    }
948061
protected function getPageArray()
    {
        $range = \range($this->firstPage, $this->lastPage);
        $pageArray = [];

        foreach ($range as $page) {
            $pageArray[] = [
                'page' => $page,
                'label' => $page,
                'type' => 'page'
            ];
        }

        return $pageArray;
    }
1048583
public static function pages()
    {
        if (!getConfig('sitemap.pages')) {
            return [];
        }

        $table = TableRegistry::get('MeCms.PagesCategories');
        $url = Cache::read('sitemap', $table->getCacheName());

        if (!$url) {
            $alias = $table->Pages->getAlias();

            $categories = $table->find('active')
                ->select(['id', 'lft', 'slug'])
                ->contain($alias, function (Query $q) use ($alias) {
                    return $q->find('active')
                        ->select(['category_id', 'slug', 'modified'])
                        ->order([sprintf('%s.modified', $alias) => 'DESC']);
                })
                ->order(['lft' => 'ASC']);

            if ($categories->isEmpty()) {
                return [];
            }

            //Adds categories index
            $url[] = self::parse(['_name' => 'pagesCategories']);

            foreach ($categories as $category) {
                //Adds the category
                $url[] = self::parse(
                    ['_name' => 'pagesCategory', $category->slug],
                    ['lastmod' => array_value_first($category->pages)->modified]
                );

                //Adds each page
                foreach ($category->pages as $page) {
                    $url[] = self::parse(['_name' => 'page', $page->slug], ['lastmod' => $page->modified]);
                }
            }

            Cache::write('sitemap', $url, $table->getCacheName());
        }

        return $url;
    }
700546
private function loadCategory()
    {
        $category   = $this->categoryFactory->create();
        $storeId    = $this->getRequest()->getParam('store');
        $categoryId = $this->getRequest()->getParam('entity_id');

        $category->setStoreId($storeId)->load($categoryId);

        return $category;
    }
1091242
public function toArray()
  {
    return [
      'current_page' => $this->current_page,
      'data' => $this->data,
      'first_page_url' => $this->first_page_url,
      'prev_page_url' => $this->prev_page_url,
      'next_page_url' => $this->next_page_url,
      'last_page_url' => $this->last_page_url,
      'per_page' => $this->per_page,
      'total' => $this->total
    ];
  }