/** * 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 ChildResourceQuery The current query, for fluid interface */ public function filterByUser($user, $comparison = null) { if ($user instanceof \App\Propel\User) { return $this->addUsingAlias(ResourceTableMap::COL_RESOURCE_ID, $user->getResourceId(), $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'); } }