original_string: public function virtualToScalable($event)
      {
          if (($this->scalableAttributeName() !== null) &&
          ($this->virtualAttributesNames() !== null)) {
  
              $data = [];
              foreach ($this->virtualAttributesNames() as $name) {
                  if (!empty($this->owner->{$name})) {
                      $data[$name] = $this->owner->{$name};
                  }
              }
  
              $this->owner->{$this->scalableAttributeName()} = $this->convert($data);
          }
      }
code: public function virtualToScalable($event)
      {
          if (($this->scalableAttributeName() !== null) &&
          ($this->virtualAttributesNames() !== null)) {
  
              $data = [];
              foreach ($this->virtualAttributesNames() as $name) {
                  if (!empty($this->owner->{$name})) {
                      $data[$name] = $this->owner->{$name};
                  }
              }
  
              $this->owner->{$this->scalableAttributeName()} = $this->convert($data);
          }
      }
code_tokens: public function virtualToScalable ( $ event ) { if ( ( $ this -> scalableAttributeName ( ) !== null ) && ( $ this -> virtualAttributesNames ( ) !== null ) ) { $ data = [ ] ; foreach ( $ this -> virtualAttributesNames ( ) as $ name ) { if ( ! empty ( $ this -> owner -> { $ name } ) ) { $ data [ $ name ] = $ this -> owner -> { $ name } ; } } $ this -> owner -> { $ this -> scalableAttributeName ( ) } = $ this -> convert ( $ data ) ; } }
docstring: Converts configured attributes before saving them to database
  
  @param mixed $event
docstring_tokens: Converts configured attributes before saving them to database