Create the request's Tree structure

@return void
11491
protected function populateStructure()
    {
        $treeStructure = [
            'blacklist_request' => [
                'card_number'    => $this->card_number,
                'terminal_token' => $this->terminal_token
            ]
        ];

        $this->treeStructure = \Genesis\Utils\Common::createArrayObject($treeStructure);
    }
225447
public function createRouteCollection()
    {
        $routeCollection  = $this->createNew(RouteCollection::class);

        $routeCollection->addRoute('GET', '/{resourceNamePlural}', [$this, 'callGetResources']);
        $routeCollection->addRoute('POST', '/{resourceNamePlural}', [$this, 'callCreateNewResource']);
        $routeCollection->addRoute('PUT', '/{resourceNamePlural}', [$this, 'callCreateNewResource']);
        $routeCollection->addRoute('HEAD', '/{resourceNamePlural}', [$this, 'callMethodNotAllowed']);
        $routeCollection->addRoute('DEL', '/{resourceNamePlural}', [$this, 'callMethodNotAllowed']);

        $routeCollection->addRoute('GET', '/{resourceNamePlural}/{id}', [$this, 'callGetResource']);
        $routeCollection->addRoute('POST', '/{resourceNamePlural}/{id}', [$this, 'callEditResource']);
        $routeCollection->addRoute('PUT', '/{resourceNamePlural}/{id}', [$this, 'callEditResource']);
        $routeCollection->addRoute('HEAD', '/{resourceNamePlural}/{id}', [$this, 'callResourceExists']);
        $routeCollection->addRoute('DEL', '/{resourceNamePlural}/{id}', [$this, 'calldDeleteResource']);

        $routeCollection->addRoute('GET', '/{resourceNamePlural}/{id}/{childNamePlural}', [$this, 'callGetChildResources']);
        $routeCollection->addRoute('POST', '/{resourceNamePlural}/{id}/{childNamePlural}', [$this, 'callCreateNewChildResource']);
        $routeCollection->addRoute('PUT', '/{resourceNamePlural}/{id}/{childNamePlural}', [$this, 'callCreateNewChildResource']);
        $routeCollection->addRoute('HEAD', '/{resourceNamePlural}/{id}/{childNamePlural}', [$this, 'callMethodNotAllowed']);
        $routeCollection->addRoute('DEL', '/{resourceNamePlural}/{id}/{childNamePlural}', [$this, 'callMethodNotAllowed']);

        return $routeCollection;
    }
1199176
public function create()
    {
        $type = NodeType::getByHandle('file');
        if (!is_object($type)) {
            NodeType::add('file');
        }
        $type = NodeType::getByHandle('file_folder');
        if (!is_object($type)) {
            NodeType::add('file_folder');
        }
        $type = NodeType::getByHandle('search_preset');
        if (!is_object($type)) {
            NodeType::add('search_preset');
        }
        $type = TreeType::getByHandle('file_manager');
        if (!is_object($type)) {
            TreeType::add('file_manager');
        }

        $manager = FileManager::get();
        if (!is_object($manager)) {
            $manager = FileManager::add();
        }

        return $manager;
    }
27130
protected function createFileStructure()
    {
        $dirs = array(
            '/var/log',
            '/var/cache',
            '/var/cache/templates',
        );

        foreach ($dirs as $dir)
        {
            if (!file_exists($this->getFsRoot() . $dir))
            {
                $umask = umask(0000);
                mkdir($this->getFsRoot() . $dir, 0777);
                umask($umask);
            }
            // TODO Сделать проверку на запись в созданные директории
        }
    }
1009053
private function createTreeArray()
    {
        $tree = [];

        foreach($this->models as $model) {
            $tree[] = [
                'id' => $model->{$this->id},
                'parent_id' => $model->{$this->parent_id},
                'model' => $model,
            ];
        }

        return $tree;
    }
916391
public function build(): DescribeNodeRequest
	{
		$instance = new DescribeNodeRequest();
		$instance->nodeId = $this->nodeId;
		$instance->backendNodeId = $this->backendNodeId;
		$instance->objectId = $this->objectId;
		$instance->depth = $this->depth;
		$instance->pierce = $this->pierce;
		return $instance;
	}
461959
protected function populateStructure()
    {
        $treeStructure = [
            'payment_transaction' => [
                'transaction_type' => \Genesis\API\Constants\Transaction\Types::AVS,
                'transaction_id'   => $this->transaction_id,
                'usage'            => $this->usage,
                'moto'             => $this->moto,
                'remote_ip'        => $this->remote_ip,
                'card_holder'      => $this->card_holder,
                'card_number'      => $this->card_number,
                'cvv'              => $this->cvv,
                'expiration_month' => $this->expiration_month,
                'expiration_year'  => $this->expiration_year,
                'customer_email'   => $this->customer_email,
                'customer_phone'   => $this->customer_phone,
                'birth_date'       => $this->birth_date,
                'billing_address'  => $this->getBillingAddressParamsStructure(),
                'shipping_address' => $this->getShippingAddressParamsStructure(),
                'risk_params'      => $this->getRiskParamsStructure()
            ]
        ];

        $this->treeStructure = \Genesis\Utils\Common::createArrayObject($treeStructure);
    }
185725
protected function insertNode()
    {
        $descendant = $this->getKey();
        $ancestor = (isset($this->parent_id) ? $this->parent_id : $descendant);

        $this->closure->insertNode($ancestor, $descendant);
    }
669024
protected function buildCategoryTree($parent, $visible, $level, $previousLevel, $maxLevel, $exclude, &$resultsList)
    {
        if ($level > $maxLevel) {
            return;
        }

        $search = CategoryQuery::create();
        $this->configureI18nProcessing($search, array('TITLE'));

        $search->filterByParent($parent);

        if ($visible !== BooleanOrBothType::ANY) {
            $search->filterByVisible($visible);
        }

        if ($exclude != null) {
            $search->filterById($exclude, Criteria::NOT_IN);
        }

        $orders  = $this->getOrder();

        foreach ($orders as $order) {
            switch ($order) {
                case "position":
                    $search->orderByPosition(Criteria::ASC);
                    break;
                case "position_reverse":
                    $search->orderByPosition(Criteria::DESC);
                    break;
                case "id":
                    $search->orderById(Criteria::ASC);
                    break;
                case "id_reverse":
                    $search->orderById(Criteria::DESC);
                    break;
                case "alpha":
                    $search->addAscendingOrderByColumn('i18n_TITLE');
                    break;
                case "alpha_reverse":
                    $search->addDescendingOrderByColumn('i18n_TITLE');
                    break;
            }
        }

        $results = $search->find();

        $needCountChild = $this->getNeedCountChild();

        foreach ($results as $result) {
            $row = array(
                "ID" => $result->getId(),
                "TITLE" => $result->getVirtualColumn('i18n_TITLE'),
                "PARENT" => $result->getParent(),
                "URL" => $this->getReturnUrl() ? $result->getUrl($this->locale) : null,
                "VISIBLE" => $result->getVisible() ? "1" : "0",
                "LEVEL" => $level,
                'PREV_LEVEL' => $previousLevel,
            );

            if ($needCountChild) {
                $row['CHILD_COUNT'] = $result->countChild();
            }

            $resultsList[] = $row;

            $this->buildCategoryTree($result->getId(), $visible, 1 + $level, $level, $maxLevel, $exclude, $resultsList);
        }
    }
1094750
public function tree()
    {
        $this->tree = true;

        $this->unsignedInteger('parentId')->nullable()->fillable();
        $this->integer('index')->fillable()->required();

        //$this->string('text', 200)->fillable()->required();

        $this->boolean('leaf')->fillable()->required();

        //Composite Unique Key ParentId-Index
        //$this->unique(array('parentId', 'index'));

        $this->foreign('parentId')
            ->references('id')
            ->on($this->table)
            ->onDelete('cascade');

        return $this;
    }
42032
protected function populateStructure()
    {
        $treeStructure = [
            'payment_transaction' => [
                'transaction_type' => $this->getTransactionType(),
                'transaction_id'   => $this->transaction_id,
                'usage'            => $this->usage,
                'remote_ip'        => $this->remote_ip
            ]
        ];

        $treeStructure['payment_transaction'] += $this->getPaymentTransactionStructure();

        $this->treeStructure = \Genesis\Utils\Common::createArrayObject($treeStructure);
    }
445428
public function createAction(Request $request)
    {
        $parentId = $request->get('id');
        $siterootId = $request->get('siteroot_id');
        $elementtypeId = $request->get('element_type_id');
        $afterId = $request->get('prev_id');
        $sortMode = $request->get('sort', 'title');
        $sortDir = $request->get('sort_dir', 'asc');
        $navigation = $request->get('navigation') ? true : false;
        $restricted = $request->get('restricted') ? true : false;
        $masterLanguage = $request->get('masterlanguage');

        $elementService = $this->get('phlexible_element.element_service');
        $treeManager = $this->get('phlexible_tree.tree_manager');

        $tree = $treeManager->getBySiteRootId($siterootId);
        $parentNode = $tree->get($parentId);
        $afterNode = $tree->get($afterId);

        $userId = $this->getUser()->getId();

        $elementSource = $elementService->findElementSource($elementtypeId);

        $element = $elementService->createElement($elementSource, $masterLanguage, $userId);

        $node = $tree->create(
            $parentNode,
            $afterNode,
            'element-'.$elementSource->getType(),
            $element->getEid(),
            [],
            $this->getUser()->getId(),
            $sortMode,
            $sortDir,
            $navigation,
            $restricted
        );

        return new ResultResponse(
            true,
            'Element EID "'.$element->getEid().' ('.$masterLanguage.')" created.',
            [
                'eid' => $element->getEid(),
                'tid' => $node->getId(),
                'master_language' => $masterLanguage,
                'navigation' => $navigation,
                'restricted' => $restricted,
            ]
        );
    }
1071708
public function buildTree()
    {
        $this->assertTreeHasRootNode();
        if (null !== $this->tree) {
            return $this->tree;
        }

        return $this->tree = $this->root->getNode(true);
    }
289810
def _build_tree(self):
        

        groups = self._groups or self.get_children_paths(self.root_path)
        for group in groups:
            node = Node(name=group, parent=self.root)
            self.root.children.append(node)
            self._init_sub_groups(node)
1166732
public function build(): RequestChildNodesRequest
	{
		$instance = new RequestChildNodesRequest();
		if ($this->nodeId === null) {
			throw new BuilderException('Property [nodeId] is required.');
		}
		$instance->nodeId = $this->nodeId;
		$instance->depth = $this->depth;
		$instance->pierce = $this->pierce;
		return $instance;
	}
1279704
function createBaseTypes()
	{
		if ( $this->baseTypesLoaded ) return;

		$types = SchemaTypes::$xsTypes;

		// SchemaTypes are organized hierarchically
		$this->types = array_reduce( array_keys( SchemaTypes::$xsTypes ), function( $carry, $type ) use( $types ) {
			/** @var QName $qn */
			$qn = \lyquidity\xml\qname( $type, array( SCHEMA_PREFIX => SCHEMA_NAMESPACE ) );
			$typeNode = array(
				'parent' => isset( $types[ $type ] ) ? $types[ $type ] : null,
				'prefix' => $qn->prefix,
				'name' => $qn->localName,
			);
			$typeNode['numeric'] = $typeNode['name'] == 'double' || $typeNode['name'] == 'decimal' || $typeNode['name'] == 'float' || ( isset( $carry[ $typeNode['parent'] ]['numeric'] ) && $carry[ $typeNode['parent'] ]['numeric'] );
			$carry[ $type ] = $typeNode;
			return $carry;
		}, array() );

		$this->baseTypesLoaded = true;
	}
1111075
public function init ()
		{
			$class = $this->_modelClass;

			$this->_root = $class::find()->roots()->one();
			if ($this->_root == null)
			{
				$root = new $class([ 'guid' => 'root', 'title' => 'ROOT' ]);
				$root->makeRoot();

				$this->_root = $class::find()->roots()->one();
				$this->_data = [];
			}
			else
				$this->_data = $this->_root->children()->all();

			$this->buildPaths();
		}