/** * Filter the query by a related \App\Propel\User object * * @param \App\Propel\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 \App\Propel\User) { return $this->addUsingAlias(RoleTableMap::COL_ROLE_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 \\App\\Propel\\User or Collection'); } }