/** * Filter the query by a related \OrderComment\Model\Thelia\Model\Order object * * @param \OrderComment\Model\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 ChildOrderCommentQuery The current query, for fluid interface */ public function filterByOrder($order, $comparison = null) { if ($order instanceof \OrderComment\Model\Thelia\Model\Order) { return $this->addUsingAlias(OrderCommentTableMap::ORDER_ID, $order->getId(), $comparison); } elseif ($order instanceof ObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(OrderCommentTableMap::ORDER_ID, $order->toKeyValue('PrimaryKey', 'Id'), $comparison); } else { throw new PropelException('filterByOrder() only accepts arguments of type \\OrderComment\\Model\\Thelia\\Model\\Order or Collection'); } }
/** * Declares an association between this object and a ChildOrder object. * * @param ChildOrder $v * @return \OrderComment\Model\OrderComment 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->getId()); } $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->addOrderComment($this); } return $this; }