создание мапы array('id'=>'parent_id')
@return type
348302
static public function getMapIdParent()
    {
        if (self::$_mapIdParent)
        {
            return self::$_mapIdParent;
        }

        $model = Cache::remember('map_tree', self::$lifeCache, function()
        {
            return DB::table('menus')->get();
        });

        $map = array();

        foreach ($model as $val)
        {
            $map[$val->id] = $val->parent_id;
        }
        unset($val);
        
        self::$_mapIdParent = $map;
       
        return $map;
    }
1336491
public function getChildren($parent_id = null)
    {
        $parent_id = $parent_id ?? $this->id;
        $children = $this::find()
            ->where(['parent_id' => $parent_id, 'show' => true])
            ->orderBy(['position' => SORT_ASC])
            ->all();
        return $children;
    }
190746
public function getDefaultStyleID()
    {
        $ids = [$this->getTitleID()];
        
        $parent = $this->getParent();
        
        while ($parent instanceof Component) {
            $ids[]  = $parent->getTitleID();
            $parent = $parent->getParent();
        }
        
        return implode('_', array_reverse($ids));
    }
461995
public function getAllParents()
    {
        $parents = array();

        $parent = $this;

        while ($parent = $parent->getParent()) {
            $parents[] = $parent;
        }

        return $parents;
    }
104437
public function getParentCategory()
    {
        $parentCategory = null;
        $currentCategory = $this->getCurrentCategory();
        if (null !== $currentCategory) {
            $parentCategoryId = $currentCategory->getParentId();
            $parentCategory = $this->_categoryRepository->get(
                $parentCategoryId,
                $this->_storeManager->getStore()->getId()
            );
            if (null !== $parentCategory && 1 >= $parentCategory->getLevel()) {
                $parentCategory = null;
            }
        }
        return $parentCategory;
    }
997218
public function getParentRecord()
    {
        //brak parenta
        if (!$this->parentId) {
            return;
        }
        //próba pobrania rodzica z cache
        if (null === $parent = \App\Registry::$cache->load($cacheKey = 'category-' . $this->parentId)) {
            //pobieranie rodzica
            \App\Registry::$cache->save($parent = (new \Cms\Orm\CmsCategoryQuery)
                ->withType()
                ->findPk($this->parentId), $cacheKey, 0);
        }
        //zwrot rodzica
        return $parent;
    }
754553
public function getParent()
    {
        $parentID = $this->getField("ParentID");
        if ($parentID) {
            return SiteTree::get_by_id(self::class, $parentID);
        }
        return null;
    }
352453
public function toArray()
    {
        $data = $this->getAttributes();

        if (!$this->hasId()) {
            unset($data[$this->uniqueIdField]);
        } else {
            $data[$this->uniqueIdField] = $this->getId();
        }

        if($children = $this->getChildren()){
           $_children = array();
            foreach($children as $child){
               $_children[] = $child->toArray();
           }
            $data["children"] = &$_children;
        }

        return $data;
    }
870211
public function getCollectionParentIDs()
    {
        $cIDs = array($this->cParentID);
        $db = Database::connection();
        $aliasedParents = $db->fetchAll('SELECT cParentID FROM Pages WHERE cPointerID = ?', array($this->cID));
        foreach ($aliasedParents as $aliasedParent) {
            $cIDs[] = $aliasedParent['cParentID'];
        }

        return $cIDs;
    }
504655
public function getTypes()
    {
        $classes = parent::getTypes();

        foreach ($classes as $k => &$definition) {

            if (empty($definition[$k]['properties'])) {
                unset($classes[$k]);
                continue;
            }

            $properties = array_filter(array_map(function ($property) {

                if (!empty($property['validation'])) {


                    foreach ($property['validation'] as &$rule){
                        foreach ($rule as $type => &$item) {

                            if ($type === 'Valid') {
                                continue;
                            } else {
                                if (!is_array($item)){
                                    $item = [];
                                }
                                $item['groups'] = ['xsd_rules'];
                            }

                        }
                        unset($item);
                    }
                    unset($rule);

                    return $property['validation'];
                }


                return null;
            }, $definition[$k]['properties']));

            if (empty($properties)) {
                unset($classes[$k]);
                continue;
            }

            $definition[$k] = [
                'properties' => $properties
            ];
        }

        return $classes;
    }
895091
public function tree()
    {
        $items = $this->model
            ->orderBy('id')
            ->orderBy('parent_id')
            ->with($this->with)
            ->get(['id', 'title', 'parent_id'])
            ->toArray();

        return $this->toTree($items);
    }
652667
public Type getParentType()
    {
        Type ret = null;
        if (this.parentTypeId != null && this.parentTypeId != 0) {
            try {
                ret = Type.get(this.parentTypeId);
            } catch (final CacheReloadException e) {
                Type.LOG.error("Could not read parentType for id: {}", this.parentTypeId);
            }
        }
        return ret;
    }
499786
public function deleteByParent( $parentId, $parentType ) {

		//$modelClass	= static::$modelClass;

		//return $modelClass::deleteByParent( $parentId, $parentType );

		$models	= $this->getByParent( $parentId, $parentType );

		foreach ( $models as $model ) {

			$this->delete( $model );
		}
	}
1071189
public function getParentIds($rootId = 0)
    {
        if ($this->_parentIds === null) {
            // 增加对模型内置[[getAll()]]方法的支持，可避免多次查询数据库，优化性能
            if ($this->owner->hasMethod('getAll')) {
                $this->_parentIds = $this->getParentIdsInternal($rootId);
            } else {
                $this->_parentIds = Tree::getParentIds($this->owner, 0, $this->pkField, $this->parentField, $rootId);
            }
        }
        
        return $this->_parentIds;
    }
676884
public function getByType( $parentId, $parentType, $type ) {

		$modelClass = static::$modelClass;

		return $modelClass::findByType( $parentId, $parentType, $type );
	}
401269
public function getParentId()
    {
        // when this field will be introduced there will be no need to load from real article
        if (isset($this->oxorderarticles__oxartparentid) && $this->oxorderarticles__oxartparentid->value !== false) {
            return $this->oxorderarticles__oxartparentid->value;
        }

        $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
        $oArticle = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
        $sQ = "select oxparentid from " . $oArticle->getViewName() . " where oxid=" . $oDb->quote($this->getProductId());
        $this->oxarticles__oxparentid = new \OxidEsales\Eshop\Core\Field($oDb->getOne($sQ));

        return $this->oxarticles__oxparentid->value;
    }
1138498
public function createType()
    {
        $clientObjectType = $this->getItemTypeName();
        $clientObject = new $clientObjectType($this->getContext());
        $clientObject->parentCollection = $this;
        return $clientObject;
    }