コード例 #1
0
ファイル: Players.php プロジェクト: scornfield/StrayAdmin
 /**
  * Declares an association between this object and a ChildTeams object.
  *
  * @param  ChildTeams $v
  * @return $this|\Players The current object (for fluent API support)
  * @throws PropelException
  */
 public function setTeams(ChildTeams $v = null)
 {
     if ($v === null) {
         $this->setMwbl('');
     } else {
         $this->setMwbl($v->getTeamAbbrev());
     }
     $this->aTeams = $v;
     // Add binding for other direction of this n:n relationship.
     // If this object has already been added to the ChildTeams object, it will not be re-added.
     if ($v !== null) {
         $v->addPlayers($this);
     }
     return $this;
 }
コード例 #2
0
 /**
  * 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');
     }
 }