예제 #1
0
 /**
  * Filter the query by a related Branch object
  *
  * @param     Branch|PropelCollection $branch The related object(s) to use as filter
  * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return    CommentQuery The current query, for fluid interface
  */
 public function filterByBranch($branch, $comparison = null)
 {
     if ($branch instanceof Branch) {
         return $this->addUsingAlias(CommentPeer::BRANCH_ID, $branch->getId(), $comparison);
     } elseif ($branch instanceof PropelCollection) {
         if (null === $comparison) {
             $comparison = Criteria::IN;
         }
         return $this->addUsingAlias(CommentPeer::BRANCH_ID, $branch->toKeyValue('PrimaryKey', 'Id'), $comparison);
     } else {
         throw new PropelException('filterByBranch() only accepts arguments of type Branch or PropelCollection');
     }
 }