Path

ez components / documentation / api reference / trunk / databaseschema


eZ Components trunk

DatabaseSchema: ezcDbSchemaPersistentWriter

[ Tutorial ] [ Class tree ] [ Element index ] [ ChangeLog ] [ Credits ]

Class: ezcDbSchemaPersistentWriter

This handler creates PHP classes to be used with PersistentObject from a DatabaseSchema. [source]

Implemented Interfaces

Method Summary

public void __construct( [$overwrite = false], [$classPrefix = null] )
Creates a new writer instance
public int getWriterType( )
Returns what type of schema writer this class implements.
public void saveToFile( $dir, $dbSchema )
Writes the schema definition in $dbSchema to files located in $dir.

Methods

__construct

void __construct( [bool $overwrite = false], [string $classPrefix = null] )
Creates a new writer instance

Parameters

Name Type Description
$overwrite bool Overwrite existsing files?
$classPrefix string Prefix for class names.

getWriterType

int getWriterType( )
Returns what type of schema writer this class implements.
This method always returns ezcDbSchema::FILE

saveToFile

void saveToFile( string $dir, ezcDbSchema $dbSchema )
Writes the schema definition in $dbSchema to files located in $dir.
This method dumps the given schema to PersistentObject definitions, which will be located in the given directory.

Parameters

Name Type Description
$dir string The directory to store definitions in.
$dbSchema ezcDbSchema The schema object to create defs for.

Throws

ClassDescription
ezcBaseFilePermissionException If the given directory is not writable.
ezcBaseFileNotFoundException If the given directory could not be found.

Last updated: Mon, 21 Dec 2009