public function addMenu(MenuEvent $event) { $menu = new Menu(); $menu->save(); $menu_i18n = new MenuI18n(); $menu_i18n->setId($menu->getId()); $menu_i18n->setTitle($event->getTitle()); $menu_i18n->setDescription($event->getDescription()); $menu_i18n->setLocale('fr_FR'); $menu_i18n->save(); $event->setId($menu->getId()); }
/** * Filter the query by a related \Menu\Model\Menu object * * @param \Menu\Model\Menu|ObjectCollection $menu The related object(s) to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return ChildMenuVersionQuery The current query, for fluid interface */ public function filterByMenu($menu, $comparison = null) { if ($menu instanceof \Menu\Model\Menu) { return $this->addUsingAlias(MenuVersionTableMap::ID, $menu->getId(), $comparison); } elseif ($menu instanceof ObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(MenuVersionTableMap::ID, $menu->toKeyValue('PrimaryKey', 'Id'), $comparison); } else { throw new PropelException('filterByMenu() only accepts arguments of type \\Menu\\Model\\Menu or Collection'); } }
/** * Declares an association between this object and a ChildMenu object. * * @param ChildMenu $v * @return \Menu\Model\MenuVersion The current object (for fluent API support) * @throws PropelException */ public function setMenu(ChildMenu $v = null) { if ($v === null) { $this->setId(NULL); } else { $this->setId($v->getId()); } $this->aMenu = $v; // Add binding for other direction of this n:n relationship. // If this object has already been added to the ChildMenu object, it will not be re-added. if ($v !== null) { $v->addMenuVersion($this); } return $this; }
/** * Exclude object from result * * @param ChildMenu $menu Object to remove from the list of results * * @return ChildMenuQuery The current query, for fluid interface */ public function prune($menu = null) { if ($menu) { $this->addUsingAlias(MenuTableMap::ID, $menu->getId(), Criteria::NOT_EQUAL); } return $this; }