/** * Filter the query by a related \ORM\User object * * @param \ORM\User|ObjectCollection $user the related object to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return ChildRoleQuery The current query, for fluid interface */ public function filterByUser($user, $comparison = null) { if ($user instanceof \ORM\User) { return $this->addUsingAlias(RoleTableMap::COL_ID, $user->getRoleId(), $comparison); } elseif ($user instanceof ObjectCollection) { return $this->useUserQuery()->filterByPrimaryKeys($user->getPrimaryKeys())->endUse(); } else { throw new PropelException('filterByUser() only accepts arguments of type \\ORM\\User or Collection'); } }