src/Data/DefaultDataProvider.php
private function convertModelToDataPropertyArray(ModelInterface $model, $timestamp = 0)
    {
        $data = [];
        foreach ($model as $key => $value) {
            if ($key === $this->idProperty) {
                continue;
            }

            if (\is_array($value)) {
                $data[$this->source . '.' . $key] = \serialize($value);
            } else {
                $data[$this->source . '.' . $key] = $value;
            }
        }

        if ($this->timeStampProperty) {
            $data[$this->source . '.' . $this->getTimeStampProperty()] = $timestamp ?: \time();
        }

        return $data;
    }
private function convertModelToDataPropertyArray(ModelInterface $model, $timestamp = 0)
    {
        $data = [];
        foreach ($model as $key => $value) {
            if ($key === $this->idProperty) {
                continue;
            }

            if (\is_array($value)) {
                $data[$this->source . '.' . $key] = \serialize($value);
            } else {
                $data[$this->source . '.' . $key] = $value;
            }
        }

        if ($this->timeStampProperty) {
            $data[$this->source . '.' . $this->getTimeStampProperty()] = $timestamp ?: \time();
        }

        return $data;
    }
private function convertModelToDataPropertyArray ( ModelInterface $ model , $ timestamp = 0 ) { $ data = [ ] ; foreach ( $ model as $ key => $ value ) { if ( $ key === $ this -> idProperty ) { continue ; } if ( \ is_array ( $ value ) ) { $ data [ $ this -> source . '.' . $ key ] = \ serialize ( $ value ) ; } else { $ data [ $ this -> source . '.' . $ key ] = $ value ; } } if ( $ this -> timeStampProperty ) { $ data [ $ this -> source . '.' . $ this -> getTimeStampProperty ( ) ] = $ timestamp ? : \ time ( ) ; } return $ data ; }
Convert a model into a property array to be used in insert and update queries.

@param ModelInterface $model     The model to convert into an property array.
@param int            $timestamp Optional the timestamp.

@return array

@SuppressWarnings(PHPMD.Superglobals)
Convert a model into a property array to be used in insert and update queries .