kernel/private/rest/classes/cache/object.php
protected function prepareData( $data )
    {
        if ( ( is_object( $data ) && !( $data instanceof ezcBaseExportable ) )
             || is_resource( $data ) )
        {
            throw new ezcCacheInvalidDataException( gettype( $data ), array( 'scalar', 'array', 'ezcBaseExportable' ) );
        }
        return "<?php\nreturn " . var_export( $data, true ) . ";\n?>\n";
    }
protected function prepareData( $data )
    {
        if ( ( is_object( $data ) && !( $data instanceof ezcBaseExportable ) )
             || is_resource( $data ) )
        {
            throw new ezcCacheInvalidDataException( gettype( $data ), array( 'scalar', 'array', 'ezcBaseExportable' ) );
        }
        return "<?php\nreturn " . var_export( $data, true ) . ";\n?>\n";
    }
protected function prepareData ( $ data ) { if ( ( is_object ( $ data ) && ! ( $ data instanceof ezcBaseExportable ) ) || is_resource ( $ data ) ) { throw new ezcCacheInvalidDataException ( gettype ( $ data ) , array ( 'scalar' , 'array' , 'ezcBaseExportable' ) ) ; } return "<?php\nreturn " . var_export ( $ data , true ) . ";\n?>\n" ; }
Serialize the data for storing.

Serializes the given $data to a executable PHP code representation
string. This works with objects implementing {@link ezcBaseExportable},
arrays and scalar values (int, bool, float, string). The return value is
executable PHP code to be stored to disk. The data can be unserialized
using the {@link fetchData()} method.

@param mixed $data
@return string

@throws ezcCacheInvalidDataException
if the $data can not be serialized (e.g. an object that does not
implement ezcBaseExportable, a resource, ...).
Serialize the data for storing .