log = mfLoghandler::singleton(); $this->preorder = $preorder; $this->new_status = $new_status; } public function run() { $this->log->debug(__METHOD__.": running trigger"); $changes = false; if(!$this->preorder->ciftoken) { $this->preorder->ciftoken = $this->preorder->createCiftoken(); $changes = true; } /*if(!$this->preorder->ciftoken) { $this->log->warning("Error creating ciftoken for preorder ".$this->preorder->id); return true; }*/ if(!$this->preorder->cifurl) { $this->preorder->cifurl = $this->preorder->generateCifUrl(); $changes = true; } if(!$this->preorder->cifcableurl) { $this->preorder->cifcableurl = $this->preorder->generateCifCableUrl(); $changes = true; } if($changes) { $this->preorder->save(); } return true; } }