/** * Filter the query by a related \SpoilerWiki\Work object * * @param \SpoilerWiki\Work|ObjectCollection $work the related object to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return ChildCanonQuery The current query, for fluid interface */ public function filterByWork($work, $comparison = null) { if ($work instanceof \SpoilerWiki\Work) { return $this->addUsingAlias(CanonTableMap::COL_ID, $work->getCanonId(), $comparison); } elseif ($work instanceof ObjectCollection) { return $this->useWorkQuery()->filterByPrimaryKeys($work->getPrimaryKeys())->endUse(); } else { throw new PropelException('filterByWork() only accepts arguments of type \\SpoilerWiki\\Work or Collection'); } }