Determine whether the cache should be busted or not based on the $element

@param $element

@return bool
546938
protected function shouldBustCache(Element $element): bool
    {
        $bustCache = true;
        // Only bust the cache if the element is ENABLED or LIVE
        if (($element->getStatus() !== Element::STATUS_ENABLED)
            && ($element->getStatus() !== Entry::STATUS_LIVE)
        ) {
            $bustCache = false;
        }

        /* @TODO: These need to be updated once the plugins are released for Craft 3
         * if (($element instanceof 'SproutSeo_Redirect')
         * || ($element instanceof 'PushNotifications_Device')
         * ) {
         * $bustCache = false;
         * }
         */

        return $bustCache;
    }
515691
public function add($element)
    {
        $this->guardAgainstDuplicatedElement($element);

        $isAdded = false;
        if (false === $this->contains($element)) {
            $isAdded = true;
            $this->offsetSet($element->uId()->id(), $element);
        }

        return $isAdded;
    }
1183490
public function remove($element) {
		$index = array_search($element, $this->collection, true);
		if ($index !== null) {
			unset($this->collection[$index]);
		}

		return $this;
	}
1002676
private function persist($element)
    {
        $this->manager->persist($element);
        /** @noinspection PhpMethodParametersCountMismatchInspection */
        $this->manager->flush($element);
    }
534035
protected function element($element = null)
    {
        return is_null($element)
            ? $this->element
            : ($this->element = $element);
    }
454488
public function remove($element)
    {
        $key = array_search($element, $this->elements, true);
        if (false !== $key) {
            unset($this->elements[$key]);
            $this->elements = array_values($this->elements);
        }
        foreach ($this->subLists as $subList) {
            $subList->drop($key, true);
        }
        return $this;
    }
865734
public function removeElement($element)
    {
        $key = array_search($element, $this->getArrayCopy());
        
        if (false !== $key)
        {
            $this->remove($key);
        }
    }
667611
public function add($element)
    {
        if (!$this->contains($element)) {
            $hashIndex = $this->hashIndex($element);

            $this->_items[$hashIndex] = $element;
            $this->_iterator = null;
            return true;
        } else {
            // element already exist
            return false;
        }
    }
1210344
function removeElement($element)
    {
        if(get_class($element) !== $this->manager->getModel()){
            throw new InvalidArgumentException("This element is not compatible with this collection, it only support  ".$this->manager->getModel());
        }

        $key = array_search($element, $this->elements, true);

        if ($key !== false) {
            unset($this->elements[$key]);

            return true;
        }

        return false;
    }
798311
public function remove($element): bool
    {
        if (($position = \array_search($element, $this->data, true)) !== false) {
            unset($this->data[$position]);

            return true;
        }

        return false;
    }
270355
private function getValueKeyFromObject($element, $key)
    {
        if (!$element instanceof \stdClass) {
            $getterName = 'get'.str_replace(' ', '', ucwords($key));

            return (method_exists($element, $getterName)) ? $element->$getterName() : false;
        }

        return (isset($element->{$key})) ? $element->{$key} : false;
    }
1337811
function isElementFrozen($element)
    {
         if (isset($this->_elementIndex[$element])) {
             return $this->_elements[$this->_elementIndex[$element]]->isFrozen();
         }
         return false;
    }
1026075
public static function stalenessOf(WebDriverElement $element)
    {
        return new static(
            function () use ($element) {
                try {
                    $element->isEnabled();

                    return false;
                } catch (StaleElementReferenceException $e) {
                    return true;
                }
            }
        );
    }
1133743
public function checkIntegrity($body, &$missingElements = null){

        $returnValue = true;

        foreach($this->elements as $element){
            if(strpos($body, $element->getPlaceholder()) === false){
                $returnValue = false;
                if(is_array($missingElements)){
                    $missingElements[$element->getSerial()] = $element;
                }else{
                    break;
                }
            }
        }


        return (bool) $returnValue;
    }
158289
public static function prep_element($element) {
		if (self::containsCode($element)===false) {
			$element='"'.addslashes($element).'"';
		}
		return $element;
	}
215587
public function without($element)
    {
        if ($element instanceof \ArrayAccess) {
            $filtered_element = clone $element;
        } else {
            $filtered_element = $element;
        }
        $args = func_get_args();
        unset($args[0]);
        foreach ($args as $arg) {
            if (isset($filtered_element[$arg])) {
                unset($filtered_element[$arg]);
            }
        }

        return $filtered_element;
    }
275380
private static function findVueIfBlocks(Element $element): array
    {
        $next = $element->getNextSibling();

        if (
            $next !== null && (
                $next->hasAttribute('v-else') ||
                $next->hasAttribute('v-else-if')
            )
        ) {
            $elements = self::findVueIfBlocks($next);
            \array_unshift($elements, $element);

            return $elements;
        }

        return [$element];
    }