tkriek/google_categories

Sort categories for different locales based on category_id and build relations with parent_id

Maintainers

Package info

github.com/TomKriek/google_categories

pkg:composer/tkriek/google_categories

Statistics

Installs: 11

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.1 2018-04-03 16:03 UTC

This package is auto-updated.

Last update: 2026-03-13 16:46:41 UTC


README

Sorting google categories with parent_id

This was meant to set up a relation between categories so they can easily be added to a database.

WIP for japanese and chinese locale because of their language constructs

iso.php file contains enabled locales to retrieve a google taxonomy file from and parse it.

Example of how to use the sorter OOP style

<?php
   
require __DIR__ . '/src/Sorter.php';
   
$json = (new \TomKriek\GoogleCategories\Sorter([], true))->sort()->sortByParent()->outputJSON(true);