/** * Filter the query by a related \SpoilerWiki\Work object * * @param \SpoilerWiki\Work|ObjectCollection $work 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 ChildMilestoneQuery The current query, for fluid interface */ public function filterBywork($work, $comparison = null) { if ($work instanceof \SpoilerWiki\Work) { return $this->addUsingAlias(MilestoneTableMap::COL_WORK_ID, $work->getId(), $comparison); } elseif ($work instanceof ObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(MilestoneTableMap::COL_WORK_ID, $work->toKeyValue('PrimaryKey', 'Id'), $comparison); } else { throw new PropelException('filterBywork() only accepts arguments of type \\SpoilerWiki\\Work or Collection'); } }