Ejemplo n.º 1
0
 /**
  * Filter the query by a related \Team\Model\Team object
  *
  * @param \Team\Model\Team|ObjectCollection $team 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 filterByTeam($team, $comparison = null)
 {
     if ($team instanceof \Team\Model\Team) {
         return $this->addUsingAlias(DealerTeamTableMap::TEAM_ID, $team->getId(), $comparison);
     } elseif ($team instanceof ObjectCollection) {
         if (null === $comparison) {
             $comparison = Criteria::IN;
         }
         return $this->addUsingAlias(DealerTeamTableMap::TEAM_ID, $team->toKeyValue('PrimaryKey', 'Id'), $comparison);
     } else {
         throw new PropelException('filterByTeam() only accepts arguments of type \\Team\\Model\\Team or Collection');
     }
 }
Ejemplo n.º 2
0
 /**
  * Declares an association between this object and a ChildTeam object.
  *
  * @param                  ChildTeam $v
  * @return                 \DealerTeam\Model\DealerTeam The current object (for fluent API support)
  * @throws PropelException
  */
 public function setTeam(ChildTeam $v = null)
 {
     if ($v === null) {
         $this->setTeamId(NULL);
     } else {
         $this->setTeamId($v->getId());
     }
     $this->aTeam = $v;
     // Add binding for other direction of this n:n relationship.
     // If this object has already been added to the ChildTeam object, it will not be re-added.
     if ($v !== null) {
         $v->addDealerTeam($this);
     }
     return $this;
 }