/** * Filter the query by a related \Batch object * * @param \Batch|ObjectCollection $batch 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 ChildRBatchForbookQuery The current query, for fluid interface */ public function filterByBatch($batch, $comparison = null) { if ($batch instanceof \Batch) { return $this->addUsingAlias(RBatchForbookTableMap::COL__BATCHID, $batch->getId(), $comparison); } elseif ($batch instanceof ObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(RBatchForbookTableMap::COL__BATCHID, $batch->toKeyValue('PrimaryKey', 'Id'), $comparison); } else { throw new PropelException('filterByBatch() only accepts arguments of type \\Batch or Collection'); } }
/** * Exclude object from result * * @param ChildBatch $batch Object to remove from the list of results * * @return $this|ChildBatchQuery The current query, for fluid interface */ public function prune($batch = null) { if ($batch) { $this->addUsingAlias(BatchTableMap::COL_ID, $batch->getId(), Criteria::NOT_EQUAL); } return $this; }