src/Phlexible/Bundle/ElementtypeBundle/Field/AbstractField.php
public function serialize($value)
    {
        if ($this->getDataType() === 'json') {
            return json_encode($value);
        } elseif ($this->getDataType() === 'array') {
            return json_encode($value);
        } elseif ($this->getDataType() === 'list') {
            return implode(',', $value);
        }

        return trim($value);
    }
public function serialize($value)
    {
        if ($this->getDataType() === 'json') {
            return json_encode($value);
        } elseif ($this->getDataType() === 'array') {
            return json_encode($value);
        } elseif ($this->getDataType() === 'list') {
            return implode(',', $value);
        }

        return trim($value);
    }
public function serialize ( $ value ) { if ( $ this -> getDataType ( ) === 'json' ) { return json_encode ( $ value ) ; } elseif ( $ this -> getDataType ( ) === 'array' ) { return json_encode ( $ value ) ; } elseif ( $ this -> getDataType ( ) === 'list' ) { return implode ( ',' , $ value ) ; } return trim ( $ value ) ; }
From object to database.

@param mixed $value

@return string
From object to database .