Set page

@param \Amulen\PageBundle\Entity\Menu $menu
@return Block
545493
public function setMenu(\Amulen\PageBundle\Entity\Menu $menu = null) {
        $this->menu = $menu;

        return $this;
    }
822177
public function setNavigationID($id) {
        if(is_string($id) && !empty(trim($id))){
            $this->menuElements['ul_id'] = $id;
        }
        if((is_string($id) && empty(trim($id))) || $id === false){
            $this->menuElements['ul_id'] = '';
        }
        return $this;
    }
813427
public function store(Menu $menu, MenulinkFormRequest $request)
    {
        $data = $request->all();
        $data['parent_id'] = null;
        $data['page_id'] = $data['page_id'] ?? null;
        $data['position'] = $data['position'] ?? 0;
        $model = $this->repository->create($data);
        Menus::forgetCache();

        return $this->redirect($request, $model);
    }
1134491
public function addMenu(\Fulgurio\LightCMSBundle\Entity\PageMenu $menu)
    {
        $this->menu[] = $menu;

        return $this;
    }
996225
private static function set( $type, $slug ) {

		global $pagenow;

		$data = self::$data[ $type ][ $slug ];

		do_action( 'wp_menu_pre_add_' . $type . '_page' );

		if ( 'menu' === $type ) {

			$page = add_menu_page(
				$data['title'],
				$data['name'],
				$data['capability'],
				$data['slug'],
				$data['function'],
				$data['icon_url'],
				$data['position']
			);

		} elseif ( 'submenu' === $type ) {

			$page = add_submenu_page(
				$data['parent'],
				$data['title'],
				$data['name'],
				$data['capability'],
				$data['slug'],
				$data['function']
			);
		}

		do_action( 'wp_menu_after_add_' . $type . '_page', 'load-' . $page );

		if ( ! $pagenow || 'admin.php' === $pagenow ) {
			self::set_action( $page, $data['styles'] );
			self::set_action( $page, $data['scripts'] );
		}
	}
676424
public function setPage(\Fulgurio\LightCMSBundle\Entity\Page $page = null)
    {
        $this->page = $page;

        return $this;
    }
484192
public function setPage($page) {
        if (!is_numeric($page)) {
            $page = self::DEFAULT_PAGE;
        }

        if (0 == $page) {
            $page = self::DEFAULT_PAGE;
        }

        $this->page = $page;

        return $this;
    }
683994
public function setPage(int $page = 1): Select
    {
        if (!$this->limit) {
            throw new DbException('Please setup limit for use method `setPage`');
        }
        $this->offset = $this->limit * ($page - 1);
        return $this;
    }
619184
public function setRoot(Page $root)
    {
        if ($this->hasMainSection()) {
            $this->getMainSection()->setRoot($root->getRoot()->getMainSection());
        }

        return $this;
    }
914740
public function setMenuPage(\Core\Entity\MenuPage $menuPage = null)
    {
        $this->menuPage = $menuPage;

        return $this;
    }
1144053
public function setPage(\Amulen\PageBundle\Entity\Page $page = null) {
        $this->page = $page;

        return $this;
    }
807708
public function setParent(\Haven\CmsBundle\Entity\TemplatePage $parent = null)
    {
        $this->parent = $parent;

        return $this;
    }
884846
public function setPage($page)
    {
        $this->offset = (max(1, (int) $page) - 1) * $this->perPage;

        return $this;
    }
539893
public function addChild(Page $page): Page
    {
        $this->children->add($page);

        if ($page->getParent() !== $this) {
            $page->setParent($this);
        }

        return $this;
    }
697106
private function createEditForm(Menu $entity)
    {
        $form = $this->createForm(new MenuType(), $entity, array(
            'action' => $this->generateUrl('admin_menu_update', array('id' => $entity->getId())),
            'method' => 'PUT',
        ));

        $form->add('submit', 'submit', array('label' => 'Update'));

        return $form;
    }
1168546
public function syncMenuAssignment($menu, $assignment)
    {
        switch ($assignment) {
            case static::ALL_PAGES:
                $this->menus()->sync([static::ALL_PAGES]);
                break;
            case static::NO_PAGES:
                $this->menus()->detach();
                break;
            case static::SELECTED_PAGES:
                $this->menus()->sync($menu);
                break;
        }

        return $this;
    }
633715
protected function registerMenu($menuBuilder, Menu $menu)
    {
        if (! $menuBuilder) {
            return false;
        }

        if (! $menu->published) {
            return false;
        }

        if ($menu->requiresAuthentication() && ! auth()->check()) {
            return false;
        }

        if (count($menu->permissions)) {
            if ($menu->authorization === 'can') {
                foreach ($menu->permissions as $permission) {
                    if (! current_user()->can($permission->slug)) {
                        return false;
                    }
                }
            } else {
                $permissions = $menu->permissions->pluck('slug')->toArray();
                if (! current_user()->canAtLeast($permissions)) {
                    return false;
                }
            }
        }

        $item = $menuBuilder->add($menu->title, url($menu->present()->url))
                            ->attribute('target', $menu->present()->target)
                            ->attribute('title', $menu->present()->linkTitle);

        if ($menu->present()->linkStyle) {
            $item->attribute('style', $menu->present()->linkStyle);
        }

        if ($menu->isActive()) {
            session()->flash('active_menu', $menu);
        }

        return $item;
    }