Clear invalid parent.
The invalid state depends on which if parent id exists but it's corresponding
parent cannot be found.
@return boolean True if parent attribute is set null, False if parent valid.
2876
public function clearInvalidParent()
    {
        if ($this->getParentId() !== static::$nullParent && !$this->hasParent()) {
            $this->setNullParent();
            return true;
        }
        return false;
    }
1162272
public function resetParent()
    {
        $sParentId = $this->oxarticles__oxparentid->value;
        $this->oxarticles__oxparentid = new \OxidEsales\Eshop\Core\Field('', \OxidEsales\Eshop\Core\Field::T_RAW);
        $this->_blAllowEmptyParentId = true;
        $this->save();
        $this->_blAllowEmptyParentId = false;

        if ($sParentId !== '') {
            $this->onChange(ACTION_UPDATE, null, $sParentId);
        }
    }
1071517
public function invalidate()
    {
        $this->parent = null;
        $this->ancestors = null;
        $this->descendants = null;
        $this->children = null;
        $this->level = null;
        $this->outlineNumbers = null;
    }
595151
public static function DeleteParent($id) {
		$getparent = Dep::where('parent', '=', $id)->get();
		foreach ($getparent as $parent) {
			$check = Dep::find($parent->id);

			if ($check->parent > 0) {
				self::DeleteParent($check->id);
				@Up::del_icon($check->icon);
				$check->delete();
			} else {
				@Up::del_icon($check->icon);
				$check->delete();
			}

		}
	}
1013673
public function validateParentID($attribute)
    {
        if ($this->{$attribute} !== NULL)
        {
            $comment = self::find()->where(['id' => $this->{$attribute}, 'entity' => $this->entity, 'entityId' => $this->entityId])->active()->exists();
            if ($comment === FALSE)
            {
                $this->addError('content', Yii::t('app', 'Oops, something went wrong. Please try again later.'));
            }
        }
    }
1128339
public function parents()
    {
        if (!$this->nodes) {
            throw new \InvalidArgumentException('The current node list is empty.');
        }

        $node = $this->getNode(0);
        $nodes = array();

        while ($node = $node->parentNode) {
            if (XML_ELEMENT_NODE === $node->nodeType) {
                $nodes[] = $node;
            }
        }

        return $this->createSubCrawler($nodes);
    }
1067137
public function Validate()
	{
		// force re-validation
		$this->ResetValidationErrors();

		$is_valid = (!$this->HasValidationErrors());

		// if validation fails, remove this object from the cache otherwise invalid values can
		// hang around and cause troubles.
		if (!$is_valid)
		{
			$this->_phreezer->DeleteCache(get_class($this), $this->GetPrimaryKeyValue());
		}

		return $is_valid;
	}
84617
protected boolean isInvalidateParent(String xpath) {

        if (!CmsXmlUtils.isDeepXpath(xpath)) {
            return false;
        }
        Boolean isInvalidateParent = null;
        // look up the default from the configured mappings
        isInvalidateParent = m_relationChecks.get(xpath);
        if (isInvalidateParent == null) {
            // no value found, try default xpath
            String path = CmsXmlUtils.removeXpath(xpath);
            // look up the default value again without indexes
            isInvalidateParent = m_relationChecks.get(path);
        }
        if (isInvalidateParent == null) {
            return false;
        }
        return isInvalidateParent.booleanValue();
    }
1121581
public function getOldChildren()
    {
        return static::find()->where([$this->parentAttribute => $this->getOldAttribute($this->refIdAttribute)])->all();
    }
542502
protected function clearEntireListParentHierarchy()
    {
        $separator = $this->getListParentSeparator();

        foreach ($this->listParents as $parent) {

            if ( ! $parent || is_string($parent) && false === strpos($parent, $separator)) {
                break;
            }

            // Unset parent at this level
            $context = $this->getModelSessionKey(
                $this->getModuleHelper()->modelSlug(get_class($parent->model))
            );

            $this->setListParentDataInMemory(null, null, $parent->relation . $separator . $parent->key, $context);
        }

        $this->setListParentDataInMemory(null, null, $this->globalSubContext());

        $this->listParentRelation  = null;
        $this->listParentRecordKey = null;
        $this->listParents         = [];
    }
1111272
public boolean parent() {
        if (mNode == null) {
            return false;
        }
        AccessibilityNodeInfoCompat parentNode = mNode.getParent();
        while (parentNode != null) {
            if (AccessibilityNodeInfoUtils.isVisibleOrLegacy(parentNode)) {
                reset(parentNode);
                return true;
            }
            AccessibilityNodeInfoCompat tmp = parentNode.getParent();
            parentNode.recycle();
            parentNode = tmp;
        }
        return false;
    }
998632
public function invalidateCache(): bool
    {
        if ($this->cache !== null) {
            $this->cache->delete($this->cacheKey);
            $this->items = null;
        }

        return true;
    }
1010801
public function valid()
    {
        if ($this->getItemPosition() >= $this->getItemOffset()
            && $this->getItemPosition() < ($this->getItemOffset() + $this->getItemCount())
        ) {
            return parent::valid();
        }
        return false;
    }
30502
public function setup()
	{
		$this->addRule('parent_id', function($data)
		{
			/*if (!isset($data['parent_id']) || $data['parent_id'] == 0)
			{
				return 'Entries must have a parent ID.';
			}*/

			if (isset($data['parent_id']) && $data['parent_id'])
			{
				$parent = self::oneOrNew($data['parent_id']);

				return $parent->get('id') ? false : 'The set parent does not exist.';
			}
			else
			{
				return false;
			}
		});
	}
329418
public function clear()
	{
		$filePath = $this->options['file.path'];
		$this->checkFilePath($filePath);

		$iterator = new \RegexIterator(
			new \RecursiveIteratorIterator(
				new \RecursiveDirectoryIterator($filePath)
			),
			'/\.data$/i'
		);

		/* @var  \RecursiveDirectoryIterator  $file */
		foreach ($iterator as $file)
		{
			if ($file->isFile())
			{
				@unlink($file->getRealPath());
			}
		}

		return true;
	}
247726
public function clear()
    {
        if (null !== $this->aStructureNodeRelatedByStructureNodeId) {
            $this->aStructureNodeRelatedByStructureNodeId->removeStructureNodeParentRelatedByStructureNodeId($this);
        }
        if (null !== $this->aStructureNodeRelatedByParentId) {
            $this->aStructureNodeRelatedByParentId->removeStructureNodeParentRelatedByParentId($this);
        }
        $this->structure_node_id = null;
        $this->parent_id = null;
        $this->alreadyInSave = false;
        $this->clearAllReferences();
        $this->resetModified();
        $this->setNew(true);
        $this->setDeleted(false);
    }
115138
public function getParentAttribute()
    {
        $parentClass = $this->block->parent_type;
        return $parentClass::find($this->block->parent_id);
    }