/** * Filter the query by a related \App\Propel\Order object * * @param \App\Propel\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 * * @throws \Propel\Runtime\Exception\PropelException * * @return ChildOrderProductQuery The current query, for fluid interface */ public function filterByOrder($order, $comparison = null) { if ($order instanceof \App\Propel\Order) { return $this->addUsingAlias(OrderProductTableMap::COL_ORDER_ID, $order->getOrderId(), $comparison); } elseif ($order instanceof ObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(OrderProductTableMap::COL_ORDER_ID, $order->toKeyValue('PrimaryKey', 'OrderId'), $comparison); } else { throw new PropelException('filterByOrder() only accepts arguments of type \\App\\Propel\\Order or Collection'); } }
/** * Declares an association between this object and a ChildOrder object. * * @param ChildOrder $v * @return $this|\App\Propel\OrderProduct The current object (for fluent API support) * @throws PropelException */ public function setOrder(ChildOrder $v = null) { if ($v === null) { $this->setOrderId(NULL); } else { $this->setOrderId($v->getOrderId()); } $this->aOrder = $v; // Add binding for other direction of this n:n relationship. // If this object has already been added to the ChildOrder object, it will not be re-added. if ($v !== null) { $v->addOrderProduct($this); } return $this; }
/** * Exclude object from result * * @param ChildOrder $order Object to remove from the list of results * * @return $this|ChildOrderQuery The current query, for fluid interface */ public function prune($order = null) { if ($order) { $this->addUsingAlias(OrderTableMap::COL_ORDER_ID, $order->getOrderId(), Criteria::NOT_EQUAL); } return $this; }