public function load($id, LazyContainer $container)
 {
     $menu = $this->menuItemDataSource->get($id, function (Selection $context) {
         $key = ':menu_has_symlink.symlink.id';
         $context->select($key)->where("{$key} IS NOT NULL");
     });
     $data = $container->getValues(TRUE);
     if ($menu) {
         $data['id_menu'] = $menu['id'];
     }
     $container->setDefaults($data);
 }
 public function load($id, LazyContainer $container)
 {
     $menu = $this->menuItemDataSource->get($id, function (\Nette\Database\Table\Selection $context) {
         $sectionIdKey = ':menu_has_submodule.submodule';
         $context->select($sectionIdKey)->where("{$sectionIdKey} IS NOT NULL");
     });
     $defaults = $container->getValues(TRUE);
     if ($menu) {
         $defaults['submodule'] = $menu['submodule'];
     }
     $container->setDefaults($defaults);
 }
 public function load($id, LazyContainer $container)
 {
     $menu = $this->menuItemDataSource->get($id, function (Selection $context) {
         $menuKeyId = ':menu_has_page.page.id';
         $context->select($menuKeyId)->where("{$menuKeyId} IS NOT NULL");
     });
     $defaults = $container->getValues(TRUE);
     if ($menu) {
         $defaults['id_page'] = $menu['id'];
     }
     $container->setDefaults($defaults);
 }
 public function load($id, LazyContainer $container)
 {
     $menu = $this->menuItemDataSource->get($id, function (Selection $context) {
         $sectionIdKey = ':menu_has_presenter.presenter';
         $context->select($sectionIdKey)->where("{$sectionIdKey} IS NOT NULL");
     });
     $defaults = $container->getValues(TRUE);
     if ($menu) {
         $defaults['presenter'] = $menu['presenter'];
     }
     $container->setDefaults($defaults);
 }
 public function save($id, LazyContainer $container)
 {
     $this->menuFacade->edit($id, $container->getValues());
 }