[READ-ONLY] Subtree split of Rocket Propelled Tortoise Core Utilities
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Format.php
ParentChildTree.php
README.md
TestCase.php
composer.json

README.md

Utilities

This is a subtree split of RocketPropelledTortoise CMS - Core. Don't send pull requests here

Work In Progress, do not use in production

This repository contains all classes for RocketPropelledTortoise CMS that are not directly tied to a specific component.

ParentChildTree

Transform a flat representation of a tree to a nested array

From

 array(
    ['id' => 1, 'text' => 'parent'],
    ['id' => 2, 'text' => 'child', 'parent_id' => 1]
 );

To

array(
    ['id' => 0, 'childs' => array(
        ['id' => 1, 'text' => 'parent', 'childs' => array(
            ['id' => 2, 'text' => 'child', 'parent_id' => 1]
        )],
    )
);
``