ScalableBehavior.php
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);
        }
    }
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);
        }
    }
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 ) ; } }
Converts configured attributes before saving them to database

@param mixed $event
Converts configured attributes before saving them to database