Beispiel #1
0
 /**
  * Set the associated Menu
  * @param Menu $menu
  */
 public function setMenu(Menu $menu)
 {
     $this->menu = $menu->getId();
 }
Beispiel #2
0
 /**
  * Adds the menu to the array
  * @param Menu $menu
  */
 public function addMenu(Menu $menu)
 {
     $id = $menu->getId();
     //If the object doesn't have an id, return
     if (is_null($id)) {
         return;
     }
     //If the Menu is already in the array, return
     foreach ($this->_menus as $idMenu) {
         if ($id->__toString() == $idMenu->__toString()) {
             return;
         }
     }
     $this->_menus[] = $id;
 }