src/Step/GenerateMenus.php
protected function collectPages()
    {
        foreach ($this->phpoole->getPages() as $page) {
            /* @var $page \PHPoole\Collection\Page\Page */
            if (!empty($page['menu'])) {
                /*
                 * Single case
                 * ie:
                 * menu: main
                 */
                if (is_string($page['menu'])) {
                    $item = (new Entry($page->getId()))
                        ->setName($page->getTitle())
                        ->setUrl($page->getPermalink());
                    /* @var $menu \PHPoole\Collection\Menu\Menu */
                    $menu = $this->phpoole->getMenus()->get($page['menu']);
                    $menu->add($item);
                } else {
                    /*
                     * Multiple case
                     * ie:
                     * menu:
                     *     main:
                     *         weight: 1000
                     *     other
                     */
                    if (is_array($page['menu'])) {
                        foreach ($page['menu'] as $name => $value) {
                            $item = (new Entry($page->getId()))
                                ->setName($page->getTitle())
                                ->setUrl($page->getPermalink())
                                ->setWeight($value['weight']);
                            /* @var $menu \PHPoole\Collection\Menu\Menu */
                            $menu = $this->phpoole->getMenus()->get($name);
                            $menu->add($item);
                        }
                    }
                }
            }
        }
    }
protected function collectPages()
    {
        foreach ($this->phpoole->getPages() as $page) {
            /* @var $page \PHPoole\Collection\Page\Page */
            if (!empty($page['menu'])) {
                /*
                 * Single case
                 * ie:
                 * menu: main
                 */
                if (is_string($page['menu'])) {
                    $item = (new Entry($page->getId()))
                        ->setName($page->getTitle())
                        ->setUrl($page->getPermalink());
                    /* @var $menu \PHPoole\Collection\Menu\Menu */
                    $menu = $this->phpoole->getMenus()->get($page['menu']);
                    $menu->add($item);
                } else {
                    /*
                     * Multiple case
                     * ie:
                     * menu:
                     *     main:
                     *         weight: 1000
                     *     other
                     */
                    if (is_array($page['menu'])) {
                        foreach ($page['menu'] as $name => $value) {
                            $item = (new Entry($page->getId()))
                                ->setName($page->getTitle())
                                ->setUrl($page->getPermalink())
                                ->setWeight($value['weight']);
                            /* @var $menu \PHPoole\Collection\Menu\Menu */
                            $menu = $this->phpoole->getMenus()->get($name);
                            $menu->add($item);
                        }
                    }
                }
            }
        }
    }
Collects pages with menu entry.