/** * Filter the query by a related File object * * @param File|PropelCollection $file The related object(s) to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return CommentQuery The current query, for fluid interface */ public function filterByFile($file, $comparison = null) { if ($file instanceof File) { return $this->addUsingAlias(CommentPeer::FILE_ID, $file->getId(), $comparison); } elseif ($file instanceof PropelCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(CommentPeer::FILE_ID, $file->toKeyValue('PrimaryKey', 'Id'), $comparison); } else { throw new PropelException('filterByFile() only accepts arguments of type File or PropelCollection'); } }