/** * Filter the query by a related \Teams object * * @param \Teams|ObjectCollection $teams 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 ChildPlayersQuery The current query, for fluid interface */ public function filterByTeams($teams, $comparison = null) { if ($teams instanceof \Teams) { return $this->addUsingAlias(PlayersTableMap::COL_MWBL, $teams->getTeamAbbrev(), $comparison); } elseif ($teams instanceof ObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(PlayersTableMap::COL_MWBL, $teams->toKeyValue('PrimaryKey', 'TeamAbbrev'), $comparison); } else { throw new PropelException('filterByTeams() only accepts arguments of type \\Teams or Collection'); } }