Exemplo n.º 1
0
 /**
  * @depends testCreate
  *
  * @param OrderModel $order
  */
 public function testModelUpdateStatusCanceledWithHelpers(OrderModel $order)
 {
     $order->setCancelled();
     $this->assertEquals($order->getStatusId(), OrderStatusQuery::create()->findOneByCode(OrderStatus::CODE_CANCELED)->getId());
     $this->assertTrue($order->isCancelled());
 }
Exemplo n.º 2
0
 /**
  * Filter the query by a related \Thelia\Model\Order object
  *
  * @param \Thelia\Model\Order|ObjectCollection $order  the related object to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildOrderStatusQuery The current query, for fluid interface
  */
 public function filterByOrder($order, $comparison = null)
 {
     if ($order instanceof \Thelia\Model\Order) {
         return $this->addUsingAlias(OrderStatusTableMap::ID, $order->getStatusId(), $comparison);
     } elseif ($order instanceof ObjectCollection) {
         return $this->useOrderQuery()->filterByPrimaryKeys($order->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByOrder() only accepts arguments of type \\Thelia\\Model\\Order or Collection');
     }
 }