code: protected function getValue($event)
      {
          if ($this->value === null && Yii::$app->has('user')) {
              $userId = Yii::$app->get('user')->id;
              if ($userId === null) {
                  return $this->getDefaultValue($event);
              }
  
              return $userId;
          } elseif ($this->value === null) {
              return $this->getDefaultValue($event);
          }
  
          return parent::getValue($event);
      }
docs: {@inheritdoc}
  
  In case, when the [[value]] property is `null`, the value of [[defaultValue]] will be used as the value.