code: public function beforeModelSave($event)
      {
          if (isset($this->dataInterface)) {
              $dataInterface = $this->dataInterface;
              if (is_object($dataInterface)) {
                  $dataInterface = $dataInterface->primaryKey;
              }
              $event->model->data_interface_id = $dataInterface;
          }
      }
docs: [[@doctodo method_description:beforeModelSave]].
  
  @param [[@doctodo param_type:event]] $event [[@doctodo param_description:event]]