Path

ez components / documentation / api reference / 1.1 / databaseschema


eZ Components 1.1

DatabaseSchema: ezcDbSchemaHandler

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

Class: ezcDbSchemaHandler

Base class for all schema handlers. [source]
The list of storage types supported by handler is returned by method getSupportedStorageTypes(). Using this list, the handler manager determines which handler to use for a given schema type. The same goes for getSupportedInternalFormats().

Member Variables

protected mixed $Params

Method Summary

public ezcDbSchemaHandler __construct( $params )
Constructs handler object, saving given parameters in the instance.
protected static bool checkWhat( $what )
Check if the specification of which database part (schema and/or data) to process is correct.
protected static file fopen( $fileName, $mode )
Exception-enabled wrapper for standard fopen()
public mixed getSchema( $schema, $internalFormat, $what )
Return schema in one of internal formats without saving it to a file or database.
public static array(string) getSupportedInternalFormats( )
Returns the list of internal formats supported by the handler.
public array loadSchema( $src, $storageType, $what )
Load schema from the specified source
public bool needsSchemaTransformation( )
Check if schema transformation is required before saving it with the handler.
protected static bool processData( $what )
Check if data should be processed by the caller.
protected static bool processSchema( $what )
Check if schema should be processed by the caller.
protected bool runHooks( $type, &$schema, $storageType, $what, $schema )
Run hooks of the specified type.
protected void runPostLoadHooks( &$schema, $storageType, $what )
Run post-load hooks, callbacks for them have been specified in constructor
protected void runPreSaveHooks( &$schema, $storageType, $what )
Run pre-save hooks, callbacks for them have been specified in constructor
public abstract bool saveDelta( $delta, $dst, $storageType )
Save given difference between schemas to the specified destination.
public bool saveSchema( $schema, $dst, $storageType, $what )
Save given schema to the specified destination.

Methods

__construct

ezcDbSchemaHandler __construct( $params )
Constructs handler object, saving given parameters in the instance.

Parameters

Name Type Description
$params  

checkWhat

bool checkWhat( $what )
Check if the specification of which database part (schema and/or data) to process is correct.

Parameters

Name Type Description
$what  

fopen

file fopen( string $fileName, string $mode )
Exception-enabled wrapper for standard fopen()

Parameters

Name Type Description
$fileName string Name of the file to open.
$mode string Mode (identical to standard fopen()).

Throws

ClassDescription
ezcDbSchemaException::GENERIC_ERROR if an error occurs.

getSchema

mixed getSchema( array $schema, string $internalFormat, string $what )
Return schema in one of internal formats without saving it to a file or database.
For example, you might want to get schema as XML string, or DOM tree, or as a set of SQL queries.

Parameters

Name Type Description
$schema array Schema to return in the specified format.
$internalFormat string Format you want to get schema in.
$what string What to get. Possible values: 'none', 'schema', 'data', 'both'. Default value is 'schema'.

See also:

ezcDbSchema::get(), ezcDbSchemaHandler::getSupportedInternalFormats().


getSupportedInternalFormats

array(string) getSupportedInternalFormats( )
Returns the list of internal formats supported by the handler.

See also:

ezcDbSchema::get(), ezcDbSchemaHandler::getSchema().


loadSchema

array loadSchema( mixed $src, string $storageType, string $what )
Load schema from the specified source

Parameters

Name Type Description
$src mixed Where to load schema from.
$storageType string Schema storage type
$what string What to load. Possible values: 'none', 'schema', 'data', 'both'. Default value is 'schema'.

needsSchemaTransformation

bool needsSchemaTransformation( )
Check if schema transformation is required before saving it with the handler.

processData

bool processData( $what )
Check if data should be processed by the caller.

Parameters

Name Type Description
$what  

processSchema

bool processSchema( $what )
Check if schema should be processed by the caller.

Parameters

Name Type Description
$what  

runHooks

bool runHooks( $type, &$schema, $storageType, $what, array $schema )
Run hooks of the specified type.

Parameters

Name Type Description
$schema array The schema to run hooks on.
$type  
&$schema  
$storageType  
$what  

runPostLoadHooks

void runPostLoadHooks( &$schema, $storageType, $what )
Run post-load hooks, callbacks for them have been specified in constructor

Parameters

Name Type Description
&$schema  
$storageType  
$what  

runPreSaveHooks

void runPreSaveHooks( &$schema, $storageType, $what )
Run pre-save hooks, callbacks for them have been specified in constructor

Parameters

Name Type Description
&$schema  
$storageType  
$what  

saveDelta

bool saveDelta( array $delta, mixed $dst, string $storageType )
Save given difference between schemas to the specified destination.

Parameters

Name Type Description
$delta array Difference to save.
$dst mixed Destination to save to.
$storageType string Storage type to use when saving the difference.

saveSchema

bool saveSchema( array $schema, mixed $dst, string $storageType, string $what )
Save given schema to the specified destination.

Parameters

Name Type Description
$schema array Schema to save.
$dst mixed Destination to save to.
$storageType string Schema storage type.
$what string What to save. Possible values: 'none', 'schema', 'data', 'both'. Default value is 'schema'.

Last updated: Wed, 28 Nov 2007