Exemple #1
0
 protected function afterMergeWith(\GO\Base\Db\ActiveRecord $model)
 {
     //move company employees to this model too.
     if ($model->className() == $this->className()) {
         $stmt = $model->contacts();
         while ($contact = $stmt->fetch()) {
             $contact->company_id = $this->id;
             $contact->save();
         }
     }
     return parent::afterMergeWith($model);
 }
Exemple #2
0
 protected function afterMergeWith(\GO\Base\Db\ActiveRecord $model)
 {
     //this contact becomes the new user contact
     if ($this->go_user_id > 0) {
         $model->go_user_id = 0;
     }
     if (!$this->photo && $model->photo) {
         rename($model->photo, $this->_getPhotoPath());
     }
     return parent::afterMergeWith($model);
 }