コード例 #1
0
ファイル: StockQuery.php プロジェクト: AlvaCorp/POS-2
 /**
  * Filter the query by a related \ORM\SalesDetail object
  *
  * @param \ORM\SalesDetail|ObjectCollection $salesDetail  the related object to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildStockQuery The current query, for fluid interface
  */
 public function filterBySales($salesDetail, $comparison = null)
 {
     if ($salesDetail instanceof \ORM\SalesDetail) {
         return $this->addUsingAlias(StockTableMap::COL_ID, $salesDetail->getStockId(), $comparison);
     } elseif ($salesDetail instanceof ObjectCollection) {
         return $this->useSalesQuery()->filterByPrimaryKeys($salesDetail->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterBySales() only accepts arguments of type \\ORM\\SalesDetail or Collection');
     }
 }