lib/ezdb/classes/ezdbinterface.php
function generateUniqueTempTableName( $pattern, $randomizeIndex = false, $server = self::SERVER_SLAVE )
    {
        $tableList = array_keys( $this->eZTableList( $server ) );
        if ( $randomizeIndex === false )
        {
            $randomizeIndex = mt_rand( 10, 1000 );
        }
        do
        {
            $uniqueTempTableName = str_replace( '%', $randomizeIndex, $pattern );
            $randomizeIndex++;
        } while ( in_array( $uniqueTempTableName, $tableList ) );

        return $uniqueTempTableName;
    }
function generateUniqueTempTableName( $pattern, $randomizeIndex = false, $server = self::SERVER_SLAVE )
    {
        $tableList = array_keys( $this->eZTableList( $server ) );
        if ( $randomizeIndex === false )
        {
            $randomizeIndex = mt_rand( 10, 1000 );
        }
        do
        {
            $uniqueTempTableName = str_replace( '%', $randomizeIndex, $pattern );
            $randomizeIndex++;
        } while ( in_array( $uniqueTempTableName, $tableList ) );

        return $uniqueTempTableName;
    }
function generateUniqueTempTableName ( $ pattern , $ randomizeIndex = false , $ server = self :: SERVER_SLAVE ) { $ tableList = array_keys ( $ this -> eZTableList ( $ server ) ) ; if ( $ randomizeIndex === false ) { $ randomizeIndex = mt_rand ( 10 , 1000 ) ; } do { $ uniqueTempTableName = str_replace ( '%' , $ randomizeIndex , $ pattern ) ; $ randomizeIndex ++ ; } while ( in_array ( $ uniqueTempTableName , $ tableList ) ) ; return $ uniqueTempTableName ; }
Generate unique table name basing on the given pattern.

If the pattern contains a (%) character then the character
is replaced with a part providing uniqueness (e.g. random number).

@param string $pattern
@param bool $randomizeIndex
@param int $server
@return string
Generate unique table name basing on the given pattern .