Searches the given key in the array of menu entries.

@access public
@param array $menuEntries
@param string $key
@return false|\Zepi\Web\General\Entity\MenuEntry
334139
public function searchMenuEntryForKey($menuEntries, $key)
    {
        foreach ($menuEntries as $menuEntry) {
            if ($menuEntry->getKey() === $key) {
                return $menuEntry;
            } 
            
            if ($menuEntry->hasChildren()) {
                $result = $this->searchMenuEntryForKey($menuEntry->getChildren(), $key);
                
                if ($result !== false) {
                    return $result;
                }
            }
        }
        
        return false;
    }
997062
public function filterByPrimaryKeys($keys)
    {
        if (empty($keys)) {
            return $this->add(null, '1<>1', Criteria::CUSTOM);
        }
        foreach ($keys as $key) {
            $cton0 = $this->getNewCriterion(PersonFunctionVersionTableMap::ID, $key[0], Criteria::EQUAL);
            $cton1 = $this->getNewCriterion(PersonFunctionVersionTableMap::VERSION, $key[1], Criteria::EQUAL);
            $cton0->addAnd($cton1);
            $this->addOr($cton0);
        }

        return $this;
    }
205488
public static function isPrimaryKey($keys)
    {
        if (!is_array($keys)) {
            $keys = [$keys];
        }
        $pks = static::getPrimaryKeyName(true);
        if (count($keys) === count($pks)) {
            return count(array_intersect($keys, $pks)) === count($pks);
        }

        return false;
    }
398664
protected function eagerCriterion(array $keys)
	{
		$this->lazy = false;

		$this->in($this->table . '.' . $this->model->getPrimaryKey(), $keys);

		return $this;
	}
614880
public function recursivelyFindAndReplaceKeysToSelf($new, $keys = null)
    {
        $keys = is_null($keys) ? $new : $keys;

        do {
            $old = $new;

            if ($this->isArray($old)) {
                return collect($old)->map(function ($item) use ($keys) {
                    return $this->recursivelyFindAndReplaceKeysToSelf($item, $keys);
                });
            }

            $new = $this->replaceKeysToSelf($new, $keys);
        } while ($old !== $new);

        return $new;
    }
76787
public synchronized TreeEntry<K, V> ceilingEntry(final K key) {
		// Retorna la clave mas cercana mayor o igual a la clave indicada
		return getRoundEntry(key, true, true);
	}
900802
private function isKeyRange($key, Array $keys)
    {
        if (empty($keys)) {
            return false;
            
        }
        return \reset($keys)->getKey() <= $key
            && \end($keys)->getKey() >= $key;
    }
1157912
public function add(MenuEntry $menu)
    {
        $menu->parent = $this;
        $menu->urlGenerator = $this->urlGenerator;
        $this->children[$menu->getName()] = $menu;

        return $menu;
    }
1062082
public static function maps(array $mappings, $key = 'default')
	{
		self::$mappings = array_merge_recursive(self::$mappings, [ $key => $mappings ]);
	}
759888
protected function insertEntry(MenuEntry $entry, $ndx = NULL) {

		if($entry instanceof DynamicMenuEntry) {
			$this->dynamicEntries[] = $entry;
		}

		if(!isset($ndx) || $ndx >= count($this->entries)) {
			$this->entries[] = $entry;
		}
		else {
			array_splice($this->entries, $ndx, 0, [$entry]);
		}

		$entry->setMenu($this);
		
		return $this;

	}
207416
public function toDictionary($key = null)
    {
        $rows = [];
        $key = $key ? : $this->getTable()->getPrimaryKey();
        foreach ($this->rows as $row) {
            $rows[$row->$key] = $row;
        }
        $this->rows = $rows;
        return $this;
    }
132859
private function applyFiltersToMenuNodes(
        ArrayCollection $menuNodes,
        $menuCode,
        $stage
    ) {
        return $menuNodes->filter(function (NodeInterface $menuNode) use ($menuCode, $stage) {

            if ($this->applyFiltersToMenuNode(
                $menuNode,
                $menuCode,
                $stage
            )
            ) {
                $menuNode->setSubnodes(
                    $this->applyFiltersToMenuNodes(
                        $menuNode->getSubnodes(),
                        $menuCode,
                        $stage
                    )
                );

                return true;
            }

            return false;
        });
    }
519465
public function searchPartByKeyAndType($key, $type = '\\Zepi\\Web\\UserInterface\\Layout\\AbstractContainer')
    {
        foreach ($this->parts as $part) {
            if ((is_a($part, $type) || is_subclass_of($part, $type)) && $part->getKey() === $key) {
                return $part;
            }
            
            $result = $part->searchPartByKeyAndType($key, $type);
            if ($result !== false) {
                return $result;
            }
        }
        
        return false;
    }
454016
public function hasKey($key)
    {
        if (array_key_exists($key, $this->data)) {
            return true;
        }

        $entity = $this->getEntity();
        if ($entity->getRepository()->getCache()->tableHasField($entity->getTable(), $key)) {
            return true;
        }

        if ($entity->getRepository()->getCache()->tableHasField($entity->getTable() . '_i18n', $key)) {
            return true;
        }

        return false;
    }
1287304
public function select(array $keys)
    {
        $list = [];
        foreach ($keys as $key) {
            if (isset($this->entries[$key])) {
                $list[$key] = $this->entries[$key];
            }
        }

        return $this->createFrom($list);
    }
154419
public function select(array $keys)
    {
        $list = [];
        foreach ($keys as $key) {
            if ($this->containsKey($key)) {
                $list[$key] = $this->get($key);
            }
        }

        return $this->createFrom($list);
    }
199583
private function configureMenus(array $menus, ContainerBuilder $container)
    {
        if (!$container->hasDefinition('ekyna_admin.menu.pool')) {
            return;
        }

        $pool = $container->getDefinition('ekyna_admin.menu.pool');

        foreach ($menus as $groupName => $groupConfig) {
            $pool->addMethodCall('createGroup', [[
                'name' => $groupName,
                'label' => $groupConfig['label'],
                'icon' => $groupConfig['icon'],
                'position' => $groupConfig['position'],
                'domain' => $groupConfig['domain'],
                'route' => $groupConfig['route'],
            ]]);
            foreach ($groupConfig['entries'] as $entryName => $entryConfig) {
                $pool->addMethodCall('createEntry', [$groupName, [
                    'name' => $entryName,
                    'route' => $entryConfig['route'],
                    'label' => $entryConfig['label'],
                    'resource' => $entryConfig['resource'],
                    'position' => $entryConfig['position'],
                    'domain' => $entryConfig['domain'],
                ]]);
            }
        }
    }