Exemplo n.º 1
0
 /**
  * Standard SS method
  * the method below is very important...
  * We initialise the order once it has an OrderItem
  */
 function onAfterWrite()
 {
     parent::onAfterWrite();
     $order = $this->Order();
     if ($order) {
         if (!$order->StatusID) {
             //this adds the modifiers and automatically WRITES AGAIN - WATCH RACING CONDITIONS!
             $order->init(true);
         }
     }
 }