Create select tag with selected parent
@param int $parentID selected structure identifier

@return string html view for select
15030
public static function createSelect($parentID = 0)
    {
        $select = '';

        $data = null;

        if (dbQuery(__CLASS__)->StructureID($parentID)->first($data)) {
            $select .= '<option title="'.$data->Name.'" selected value="'.$data->id.'">'.$data->Name.'</option>';
        } else {
            $select .= '<option title="' . t('Не выбрано', true) . '" value="NULL">'
                . t('Не выбрано', true) . '</option>';
        }

        if (dbQuery(__CLASS__)->Active(1)->exec($allNavs)) {
            foreach ($allNavs as $nav) {
                $select .= '<option title="'.$nav->Name.'" value="'.$nav->id.'">'.$nav->Name.'</option>';
            }
        }
        return $select;
    }
1341888
public function getNodesTree($nodes, $parentId)
    {
        return collect($nodes)->filter(function ($value) use ($parentId) {
            if (isset($value['parent_id'])) {
                if ($value['parent_id'] == $parentId) {
                    return true;
                }

                return false;
            }

            return true;
        })->mapWithKeys(function ($value, $key) use ($nodes) {
            $data = [
                'id'    => (string) $value['id'],
                'label' => $value['label'],
            ];

            if (isset($value['parent_id'])) {
                $children = $this->getNodesTree($nodes, $value['id']);
                if ($children->isNotEmpty()) {
                    $data['children'] = $children;
                }
            }

            return [
                $key => $data,
            ];
        })->values();
    }
1344361
public static function parentID($menuLinkID)
    {
        $parentIDs = [];
        while($menuLinkID != null){
            $parentObj = MenuLink::all()->where('menuLinkID', $menuLinkID)->first();
            if ($parentObj) {
                $menuLinkID = $parentObj->parent;
                if ($menuLinkID) {
                    $parentIDs[] = $menuLinkID;
                }
            }
            if ($parentObj || !$menuLinkID) {
                $menuLinkID = null;
            }
        }
        return $parentIDs;
    }
931143
public function getParentId()
    {
        return (is_string($this->parentAttribute) && !empty($this->parentAttribute)) ?
        $this->{$this->parentAttribute} : null;
    }
1311436
public function html(string $html, array $parentAttributes = [])
    {
        return $this->add(Html::raw($html)->setParentAttributes($parentAttributes));
    }
13999
public function newTagCreateStruct($parentTagId, $mainLanguageCode)
    {
        $tagCreateStruct = new TagCreateStruct();
        $tagCreateStruct->parentTagId = $parentTagId;
        $tagCreateStruct->mainLanguageCode = $mainLanguageCode;

        return $tagCreateStruct;
    }
943046
public static function queryByParent( $parentId, $parentType ) {

		$tableName = static::tableName();

		return self::queryWithModel()->where( "$tableName.parentId=:pid AND $tableName.parentType=:ptype", [ ':pid' => $parentId, ':ptype' => $parentType ] );
	}
439058
public static function getNavigationalBreadcrumbs($parentId, $crumbs = [])
    {
        $menuItems = self::getMenuItems('id');

        if (in_array($parentId, $menuItems)) {
            array_unshift($crumbs, [
                'link' => $menuItems[$parentId]->url,
                'text' => $menuItems[$parentId]->title,
            ]);

            if (!is_null($menuItems[$parentId]->parent_id)) {
                $crumbs = Breadcrumbs::getNavigationalBreadcrumbs($menuItems[$parentId]->parent_id, $crumbs);
            }
        }

        return $crumbs;
    }
242897
function makeSelection($id){ 
        /*@var parentElement /SimplOn/Elements/Element */
        //$orig_sid = Main::$globalSID;
       
        $this->element->fillFromDSById($id);
        //$parentElement = new $parentClass();
        //Main::$globalSID = $orig_sid;
        //$template = $parentElement->templateFilePath('View');
        
        $return = array(
			'status' => true,
			'type' => 'commands',
			'data' => array(
                array(
                    'func' => 'changeValue',
                    'args' => array($this->element->getId())
                ),
                array(
                    'func' => 'changePreview',
                    //'args' => array($this->showInputView(Main::$GENERIC_TEMPLATES_PATH . $short_template, true).'')
                    'args' => array($this->showInputView())
                ),
                array(
                    'func' => 'closeLightbox'
                ),
            )
        );

        header('Content-type: application/json');
        echo json_encode($return);

        
    }
1161270
public function removeParent(string $parentId, bool $setParentsChild = true): NodeInterface
    {
        if (isset($this->_parents[$parentId])) {
            $parent = $this->getParent($parentId);

            $this->notifySubscribers(
                self::EVENT_REMOVE_PARENT,
                ['oldParents' => $this->_parents, 'parentToRemove' => $parent, 'child' => $this]
            );

            if ($setParentsChild) {
                $parent->removeChild($this->getId(), false);
            }

            unset($this->_parents[$parentId]);
        }

        return $this;
    }
1100486
public function create($name, $parentid = 1, $order = null, $id = null)
    {
        $params = array(
                   'name'       => $name,
                   'parentid'   => $parentid,
                   'order'      => $order,
                   'id'         => $id
                );

        $response = $this->http->jsonPost(self::API_CREATE, $params);

        return $response['id'];
    }
1235594
public function getParent($parentId)
    {
        if ($parentId && isset($this->site->pages[$parentId])) {
            return $this->site->pages[$parentId];
        }

        return [];
    }
165384
public function createInHierarchy( $parentId, $parentType, $rootId, $childId ) {

		$root = $this->getRoot( $rootId, $parentType );

		// Add Root
		if( !isset( $root ) ) {

			$model	= $this->getModelObject();

			$model->rootId		= $rootId;
			$model->parentType	= $parentType;
			$model->lValue		= CoreGlobal::HIERARCHY_VALUE_L;
			$model->rValue		= CoreGlobal::HIERARCHY_VALUE_R;

			// Create Model
			$model->save();
		}

		$model	= $this->getModelObject();

		$model->rootId		= $rootId;
		$model->parentType	= $parentType;

		$model->parentId	= $parentId;
		$model->childId		= $childId;

		// Create Model
		$model->save();
	}
1319861
public function getFollowersIdList( $parentId, $parentType ) {

        return self::findList( [  'column' => 'modelId', 'conditions' => [ 'type' => IFollower::TYPE_FOLLOW, 'active' => true, 'parentId' => $parentId, 'parentType' => $parentType ] ] );
    }
1311199
public function subselect($parentQuery, $select = '*')
    {
        //Argument 2 must be a string
        Argument::i()->test(2, 'string');
        
        return Subselect::i($parentQuery, $select);
    }
473792
public function getNextPosition($parentId)
    {
        $query = $this->getEntityManager()->createQuery('SELECT MAX(p.position) FROM FulgurioLightCMSBundle:Page p WHERE p.parent=:parentId AND p.page_type=:pageType');
        $query->setParameter('pageType', 'page');
        $query->setParameter('parentId', $parentId);
        return $query->getSingleScalarResult() + 1;
    }
861649
public function getCountByParent( $parentId, $parentType ) {

		$modelClass	= static::$modelClass;

		return $modelClass::queryByParent( $parentId, $parentType )->count();
	}