PMA\libraries\navigation\NavigationTree::_addTableContainers PHP Method

_addTableContainers() private method

References to existing children are returned if this function is called twice on the same node
private _addTableContainers ( NodeTable $table, integer $pos2, string $type3, integer $pos3 ) : array
$table PMA\libraries\navigation\nodes\NodeTable The table node, new containers will be attached to this node
$pos2 integer The position for the pagination of the branch at the second level of the tree
$type3 string The type of item being paginated on the third level of the tree
$pos3 integer The position for the pagination of the branch at the third level of the tree
return array An array of new nodes
    private function _addTableContainers($table, $pos2, $type3, $pos3)
    {
        $retval = array();
        if ($table->hasChildren(true) == 0) {
            if ($table->getPresence('columns')) {
                $retval['columns'] = NodeFactory::getInstance('NodeColumnContainer');
            }
            if ($table->getPresence('indexes')) {
                $retval['indexes'] = NodeFactory::getInstance('NodeIndexContainer');
            }
            if ($table->getPresence('triggers')) {
                $retval['triggers'] = NodeFactory::getInstance('NodeTriggerContainer');
            }
            // Add all new Nodes to the tree
            foreach ($retval as $node) {
                $node->pos2 = $pos2;
                if ($type3 == $node->real_name) {
                    $node->pos3 = $pos3;
                }
                $table->addChild($node);
            }
        } else {
            foreach ($table->children as $node) {
                if ($type3 == $node->real_name) {
                    $node->pos3 = $pos3;
                }
                $retval[$node->real_name] = $node;
            }
        }
        return $retval;
    }