/** * Filter the query by a related \Dealer\Model\Dealer object * * @param \Dealer\Model\Dealer|ObjectCollection $dealer The related object(s) to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return ChildDealerTeamQuery The current query, for fluid interface */ public function filterByDealer($dealer, $comparison = null) { if ($dealer instanceof \Dealer\Model\Dealer) { return $this->addUsingAlias(DealerTeamTableMap::DEALER_ID, $dealer->getId(), $comparison); } elseif ($dealer instanceof ObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(DealerTeamTableMap::DEALER_ID, $dealer->toKeyValue('PrimaryKey', 'Id'), $comparison); } else { throw new PropelException('filterByDealer() only accepts arguments of type \\Dealer\\Model\\Dealer or Collection'); } }
/** * Declares an association between this object and a ChildDealer object. * * @param ChildDealer $v * @return \DealerTeam\Model\DealerTeam The current object (for fluent API support) * @throws PropelException */ public function setDealer(ChildDealer $v = null) { if ($v === null) { $this->setDealerId(NULL); } else { $this->setDealerId($v->getId()); } $this->aDealer = $v; // Add binding for other direction of this n:n relationship. // If this object has already been added to the ChildDealer object, it will not be re-added. if ($v !== null) { $v->addDealerTeam($this); } return $this; }