delete cached values based on an input array

@param array $keyArray
@return bool
503307
public function deleteFromList(array $keyArray = []) : bool
    {
        if (!$keyArray) {
            return false;
        }

        foreach ($keyArray as $key_del) {
            if (!$this->entryMetaData) {
                break;
            }

            foreach ($this->entryMetaData as $key) {
                if (stripos($key, strtolower($key_del) !== false)) {
                    $this->delete($key);
                }
            }
        }

        return true;
    }
1012481
static public function sortByKeyRecursive(array $array)
    {
        ksort($array);
        foreach ($array as $key => $value) {
            if (is_array($value) && !empty($value)) {
                $array[$key] = self::sortByKeyRecursive($value);
            }
        }

        return $array;
    }
810716
public function deleteMultiple($keys)
    {
        $this->throwInvalidArrayArgumentException($keys);

        foreach($keys as $key) {
            $this->delete($key);
        }

        return true;
    }
1060825
public static function removeKeys($array, $removeKeys)
    {
        $result = [];
        if (!is_array($removeKeys)) {
            $removeKeys = [$removeKeys];
        }
        foreach ($array as $key => $value) {
            if (is_array($value)) {
                $value = self::removeKeys($value, $removeKeys);
            }
            if (in_array($key, $removeKeys)) {
                continue;
            } else {
                $result[$key] = $value;
            }
        }
        return $result;
    }
507866
public function deleteAll(array $keys) : bool
    {
        if (empty($keys)) {
            return false;
        }

        $status = true;

        foreach ($keys as $key) {
            $status = $status && $this->delete($key);
        }

        return $status;
    }
1064990
protected function removeDeletedArrayEntries(array $array = null, array $previousArray)
    {
        foreach ($previousArray as $item) {
            if ($item['type'] === 'array') {
                $this->removeDeletedArrayEntries($array[$item['index']], $item['value']);
            } elseif ($this->getTypeName($item['type']) === 'object' && !($item['type'] === 'DateTime' || $item['type'] === 'SplObjectStorage')) {
                if (!$this->persistenceSession->hasIdentifier($item['value']['identifier'])) {
                    // ingore this identifier, assume it was blocked by security query rewriting
                    continue;
                }

                $object = $this->persistenceSession->getObjectByIdentifier($item['value']['identifier']);
                if ($array === null || !$this->arrayContainsObject($array, $object, $item['value']['identifier'])) {
                    if ($this->reflectionService->getClassSchema($item['type'])->getModelType() === ClassSchema::MODELTYPE_ENTITY
                            && $this->reflectionService->getClassSchema($item['type'])->isAggregateRoot() === false) {
                        $this->removeEntity($this->persistenceSession->getObjectByIdentifier($item['value']['identifier']));
                    } elseif ($this->reflectionService->getClassSchema($item['type'])->getModelType() === ClassSchema::MODELTYPE_VALUEOBJECT) {
                        $this->removeValueObject($this->persistenceSession->getObjectByIdentifier($item['value']['identifier']));
                    }
                }
            }
        }
    }
49202
private function delete(array &$array, $key)
    {
        $key = trim($key, '.');
        if (strpos($key, '.') !== false) {
            $explode = explode('.', $key);
            $this->delete($array[$explode[0]], $explode[1]);
        } else {
            unset($array[$key]);
        }
    }
667587
public static function has(array $array, $keyPath)
    {
        self::checkKeyPathIsValidAndNonEmpty($keyPath);
        $keys = self::explodeKeys(strval($keyPath));

        while ($keys !== array()) {
            $key = array_shift($keys);

            if (!array_key_exists($key, $array)) {
                return false;
            }
            $array = $array[$key];
            if (!is_array($array)) {
                break;
            }
        }

        return $keys === array();
    }
240418
public static function remove(array &$array, $keyPath)
    {
        self::checkKeyPathIsValidAndNonEmpty($keyPath);
        $result = $array;
        $keys = self::explodeKeys(strval($keyPath));
        $ptr = &$result;

        while ($keys !== array()) {
            $key = array_shift($keys);

            if (!array_key_exists($key, $ptr)) {
                $ptr[$key] = array();
                $ptr = &$ptr[$key];
                continue;
            }
            $prevPtr = &$ptr;
            $ptr = &$ptr[$key];
            if ($keys === array()) {
                unset($prevPtr[$key]);
                $array = $result;
                return;
            }
            elseif (!is_array($ptr)) {
                throw new KeyNotFound($keyPath);
            }
        }

        throw new KeyNotFound($keyPath);
    }
515020
public static function hasKey(Array $array, Array $keys)
    {
        foreach ($array as $key => $value) {
            if (in_array($key, $keys)) {
                return true;
            }
        }

        return false;
    }
910850
public final function deleteItems(array $keys)
   {
       try {
           foreach ($keys as $value) {
               if (!$this->deleteItem($value)) {
                   return false;
               }
           }
       } catch (InvalidArgumentException $e) {
           throw $e;
       }
       return true;
   }
454314
protected function isPureArray(array $array ) {
            $i=0;
            foreach($array as $k=>$v) {
                if ( $k !== $i ) {
                   return false;
                }
                $i++;
            }

            return true;
        }
148717
protected function purgeArray(array $array = array()) {

        $result = array();
        $keys   = array_keys($array);

        $this->addBasicPurgeFilters();

        if (!empty($keys) && !empty($this->purgeFilters)) {
            foreach ($keys as $key) {
                $allowed = true;

                foreach ($this->purgeFilters as $filter) {
                    $allowed = $filter($key);

                    if (!$allowed) {
                        break;
                    }
                }

                if ($allowed) {
                    $result[$key] = $array[$key];
                }
            }
        }

        return $result;
    }
1049708
public function deleteItems(array $keys): bool
    {
        foreach ($keys as $key) {
            $this->delete($key);
        }

        return true;
    }
781165
public static function delete(array &$array, string $path): bool
	{
		$segments = explode('.', $path);

		while(count($segments) > 1)
		{
			$segment = array_shift($segments);

			if(!isset($array[$segment]) || !is_array($array[$segment]))
			{
				return false;
			}

			$array =& $array[$segment];
		}

		unset($array[array_shift($segments)]);

		return true;
	}
584933
public static function removeValue(&$array, $key, $default = null)
    {
        if (is_array($array)) {
            $value = static::getValue($array, $key, $default);
            unset($array[$key]);
            return static::value($value);
        }
        return self::value($default);
    }
62523
protected static function deleteMultiple(array &$arr, array $keys)
    {
        $return = [];
        foreach ($keys as $key) {
            $return[$key] = static::delete($arr, $key);
        }

        return $return;
    }