/** * Filter the query by a related \Menu\Model\MenuItem object * * @param \Menu\Model\MenuItem|ObjectCollection $menuItem the related object to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return ChildMenuQuery The current query, for fluid interface */ public function filterByMenuItem($menuItem, $comparison = null) { if ($menuItem instanceof \Menu\Model\MenuItem) { return $this->addUsingAlias(MenuTableMap::ID, $menuItem->getMenuId(), $comparison); } elseif ($menuItem instanceof ObjectCollection) { return $this->useMenuItemQuery()->filterByPrimaryKeys($menuItem->getPrimaryKeys())->endUse(); } else { throw new PropelException('filterByMenuItem() only accepts arguments of type \\Menu\\Model\\MenuItem or Collection'); } }