code: public function clean()
      {
          if (isset($this->foreignObject)) {
              $this->foreignPrimaryKey = $this->foreignObject->primaryKey;
              $this->foreignObject = null;
          }
          if (isset($this->localObject)) {
              $this->localPrimaryKey = $this->localObject->primaryKey;
              $this->localObject = null;
          }
          Yii::getLogger()->flush();
      }
docs: [[@doctodo method_description:clean]].