Checks if the given array of item children contains at least one
URL that is allowed to the current user.

@param array $children item children
@return bool
10108
protected function _hasAllowedChildren(array $children): bool
    {
        foreach ($children as $child) {
            if ($this->Auth->urlAllowed($child['url'])) {
                return true;
            }
        }

        return false;
    }
1227208
public function containsAnyOf(array $elements): bool
    {
        if (!is_scalar($this->value) || null === $this->value) {
            return false;
        }

        foreach ($elements as $needle) {
            if (is_bool($needle) && $this->value === $needle) {
                return true;
            } elseif (!is_bool($needle) && ($this->value === $needle || (is_string($this->value) && false !== strpos($this->value, (string) $needle)))) {
                return true;
            }
        }

        return false;
    }
734091
public function hasChildrenVisible()
    {
        foreach ($this->getChildren() as $child) {
            if ($child->getState() == static::STATE_ONLINE) {
                return true;
            }
        }

        return false;
    }
1020151
public static function has($array, $keys)
	{
		if(is_null($keys) || ! $array)
		{
			return false;
		}

		$keys = (array) $keys;
		if($keys === [])
		{
			return false;
		}

		foreach($keys as $key)
		{
			if(static::exists($array, $key))
			{
				continue;
			}

			if( strpos($key, ".") !== false )
			{
				$subKeyArray = $array;
				for($i = 0, $map = explode('.', $key), $len = count($map); $i < $len; $i++)
				{
					$segment = $map[$i];
					if( ($i < 1 || static::accessible($subKeyArray)) && static::exists($subKeyArray, $segment) )
					{
						if( $i + 1 < $len )
						{
							$subKeyArray = $subKeyArray[$segment];
						}
					}
					else
					{
						return false;
					}
				}
			}
		}

		return true;
	}
1323153
public function appendChildArray(array $children = null)
    {
        if (is_array($children) && !empty($children)) {
            foreach ($children as $child) {
                $this->appendChild($child);
            }
        }
    }
1063217
public function purgeUrls(array $urls)
    {
        foreach ($urls as $url) {
            $success = $this->sendPurgeRequest([
                    'url'      => $url,
                    'headers'  => $this->headers
                ]
            );

            if (!$success) {
                return false;
            }
        }

        return true;

    }
954747
protected function checkSameSlotForKeys(array $keys)
    {
        if (!$count = count($keys)) {
            return false;
        }

        $currentSlot = $this->getSlotByKey($keys[0]);

        for ($i = 1; $i < $count; ++$i) {
            $nextSlot = $this->getSlotByKey($keys[$i]);

            if ($currentSlot !== $nextSlot) {
                return false;
            }

            $currentSlot = $nextSlot;
        }

        return true;
    }
1192826
public function containsKeys(array $needles, $recursive = false): bool
    {
        if ($recursive === true) {
            return \count(
                       \array_intersect($needles, $this->keys(true)->getArray()),
                       \COUNT_RECURSIVE
                   )
                   ===
                   \count(
                       $needles,
                       \COUNT_RECURSIVE
                   );
        }

        return \count(
                   \array_intersect($needles, $this->keys()->getArray()),
                   \COUNT_NORMAL
               )
               ===
               \count(
                   $needles,
                   \COUNT_NORMAL
               );
    }
193629
public function has_all(array $keys) {
        foreach ($keys as $key) {
            if (!$this->has($key)) {
                return false;
            }
        }
        return true;
    }
1077147
public function containsEntities(array $entities)
    {
        foreach ($entities as $entity) {
            if (!$this->entities->contains($entity)) {
                return false;
            }
        }

        return true;
    }
1144272
private boolean hasSelectedChildren(List<CmsCategoryTreeEntry> children, Collection<String> selectedCategories) {

        boolean result = false;
        if (children == null) {
            return false;
        }
        for (CmsCategoryTreeEntry child : children) {
            result = selectedCategories.contains(child.getSitePath());
            if (result || hasSelectedChildren(child.getChildren(), selectedCategories)) {
                return true;
            }
        }

        return result;
    }
981360
public static function has($array, $keys): bool
    {
        if (null === $keys) {
            return false;
        }

        $keys = (array)$keys;

        if (!$array) {
            return false;
        }

        if ($keys === []) {
            return false;
        }

        foreach ($keys as $key) {
            $subKeyArray = $array;

            if (static::exists($array, $key)) {
                continue;
            }

            foreach (explode('.', $key) as $segment) {
                if (static::accessible($subKeyArray) && static::exists($subKeyArray, $segment)) {
                    $subKeyArray = $subKeyArray[$segment];
                } else {

                    return false;
                }
            }
        }

        return true;
    }
376949
public function containsAll($elements): bool {
        $contains = false;
        if (\is_iterable($elements)) {
            foreach ($elements as $element) {
                $contains &= $this->contains($element);
            }
        }
        return $contains;
    }
661446
public function has_all(array $keys) {
        foreach ($keys as $key) {
            if (!is_array($key)) {
                $key = array('key' => $key);
            }
            $key = $key['key'];
            if (!isset($this->store[$key])) {
                return false;
            }
        }
        return true;
    }
784713
public function has_children() {
        return ($this->nodetype === navigation_node::NODETYPE_BRANCH || $this->children->count()>0 || $this->isexpandable);
    }
470377
public function createDirectory($path, $children = []) {
        $success = true;
        if (is_array($path)) {
            foreach ($path as $item) {
                $this->createDirectory($item);
            }
        } elseif (is_scalar($path)) {
            echo "\n Creating $path ";
            if (strpos($path, '/') !== false) {
                $pathParts = explode("/", $path);
                $path = '';
                foreach ($pathParts as $item) {
                    if (!empty($item)) {
                        $path .= $item;
                        if (!file_exists($path)) {
                            mkdir($path);
                        }
                        $path .= '/';
                    }
                }
            } else {
                if (file_exists($path)) {
                    $success = true;
                } else {
                    $success = mkdir($path);
                }
            }

            if (!$success) {
                throw new \Exception("Error creating $path");
            }

            if ($children) {
                foreach ($children as $item) {
                    $this->createDirectory($path . '/' . $item);
                }
            }
        }        
    }
719461
public function haveSameParents(array $nodes)
    {
        $firstRes = array_pop($nodes);
        $tmp = $firstRes['parent_id'];

        foreach ($nodes as $node) {
            if ($tmp !== $node['parent_id']) {
                return false;
            }
        }

        return true;
    }