Path

ez components / documentation / api reference / 2008.2.3 / databaseschema


eZ Components 2008.2.3

DatabaseSchema: ezcDbSchemaPersistentClassWriter

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

Class: ezcDbSchemaPersistentClassWriter

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
ezcBaseFileNotFoundException If the given directory could not be found.
ezcBaseFilePermissionException If the given directory is not writable.

Last updated: Mon, 11 May 2009