/** * Filter the query by a related \Thelia\Model\Order object * * @param \Thelia\Model\Order|ObjectCollection $order The related object(s) to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return ChildOrderCouponQuery The current query, for fluid interface */ public function filterByOrder($order, $comparison = null) { if ($order instanceof \Thelia\Model\Order) { return $this->addUsingAlias(OrderCouponTableMap::ORDER_ID, $order->getId(), $comparison); } elseif ($order instanceof ObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(OrderCouponTableMap::ORDER_ID, $order->toKeyValue('PrimaryKey', 'Id'), $comparison); } else { throw new PropelException('filterByOrder() only accepts arguments of type \\Thelia\\Model\\Order or Collection'); } }