/** * Filter the query by a related \Models\Note object * * @param \Models\Note|ObjectCollection $note The related object(s) to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @throws \Propel\Runtime\Exception\PropelException * * @return ChildCommentQuery The current query, for fluid interface */ public function filterByNote($note, $comparison = null) { if ($note instanceof \Models\Note) { return $this->addUsingAlias(CommentTableMap::COL_NOTE_ID, $note->getId(), $comparison); } elseif ($note instanceof ObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(CommentTableMap::COL_NOTE_ID, $note->toKeyValue('PrimaryKey', 'Id'), $comparison); } else { throw new PropelException('filterByNote() only accepts arguments of type \\Models\\Note or Collection'); } }