core/xpdo/om/xpdomanager.class.php

Show: inherited
Table of Contents

The xPDOManager class provides data source management.

Package
xpdo  
Subpackage
om  

\xPDOManager

Package: xpdo\om

Provides data source management for an xPDO instance.

These are utility functions that only need to be loaded under special circumstances, such as creating tables, adding indexes, altering table structures, etc. xPDOManager class implementations are specific to a database driver and should include this base class in order to extend it.

Children
\xPDOManager_sqlite
\xPDOManager_mysql
\xPDOManager_sqlsrv
Abstract
 

Properties

Propertypublic\xPDOGenerator  $generator= 'null'

The generator class for forward and reverse engineering tasks (loaded only on demand).
Default valuenullDetails
Type
\xPDOGenerator
Propertypublic\xPDOTransport  $transport= 'null'

The data transport class for migrating data.
Default valuenullDetails
Type
\xPDOTransport
Propertypublic\xPDO  $xpdo= 'null'

A reference to the XPDO instance using this manager.
Default valuenullDetails
Type
\xPDO
Access
public  

Methods

methodpublic__construct( object $xpdo ) : void

Get a xPDOManager instance.

Parameters
Name Type Description
$xpdo object

A reference to a specific modDataSource instance.

methodpublicaddConstraint( string $class, string $name, array $options = array() ) : boolean
abstract

Add a constraint to an object container, e.g. ADD CONSTRAINT.

Parameters
Name Type Description
$class string

The object class to add the constraint to.

$name string

The name of the constraint to add.

$options array

An array of options for the process.

Returns
Type Description
boolean True if the constraint is added successfully, otherwise false.
methodpublicaddField( string $class, string $name, array $options = array() ) : boolean
abstract

Add a field to an object container, e.g. ADD COLUMN.

Parameters
Name Type Description
$class string

The object class to add the field to.

$name string

The name of the field to add.

$options array

An array of options for the process.

Returns
Type Description
boolean True if the column is added successfully, otherwise false.
methodpublicaddIndex( string $class, string $name, array $options = array() ) : boolean
abstract

Add an index to an object container, e.g. ADD INDEX.

Parameters
Name Type Description
$class string

The object class to add the index to.

$name string

The name of the index to add.

$options array

An array of options for the process.

Returns
Type Description
boolean True if the index is added successfully, otherwise false.
methodpublicalterField( string $class, string $name, array $options = array() ) : boolean
abstract

Alter an existing field of an object container, e.g. ALTER COLUMN.

Parameters
Name Type Description
$class string

The object class to alter the field of.

$name string

The name of the field to alter.

$options array

An array of options for the process.

Returns
Type Description
boolean True if the column is altered successfully, otherwise false.
methodpublicalterObjectContainer( string $className, array $options = array() ) : boolean
abstract

Alter the structure of an existing persistent data object container.

Parameters
Name Type Description
$className string

The class of object to alter the container of.

$options array

An array of options describing the alterations to be made.

Returns
Type Description
boolean Returns true on successful alteration, false on failure.
methodpubliccreateObjectContainer( string $className ) : boolean
abstract

Creates the container for a persistent data object.

An object container is a synonym for a database table.

Parameters
Name Type Description
$className string

The class of object to create a source container for.

Returns
Type Description
boolean Returns true on successful creation, false on failure.
methodpubliccreateSourceContainer( array $dsnArray = null, string $username = null, string $password = null, array $containerOptions = array () ) : boolean
abstract

Creates the physical container representing a data source.

Parameters
Name Type Description
$dsnArray array

An array of xPDO configuration properties.

$username string

Database username with privileges to create tables.

$password string

Database user password.

$containerOptions array

An array of options for controlling the creation of the container.

Returns
Type Description
boolean True if the database is created successfully or already exists.
methodprotectedgetColumnDef( string $class, string $name, string $meta, array $options = array() ) : string
abstract

Get the SQL necessary to define a column for a specific database engine.

Parameters
Name Type Description
$class string

The name of the class the column represents a field of.

$name string

The name of the field and physical database column.

$meta string

The metadata defining the field.

$options array

An array of options for the process.

Returns
Type Description
string A string of SQL representing the column definition.
methodpublicgetGenerator( ) : \xPDOGenerator

Gets an XML schema parser / generator for this manager instance.

Returns
Type Description
\xPDOGenerator A generator class for this manager.
methodprotectedgetIndexDef( string $class, string $name, string $meta, array $options = array() ) : string
abstract

Get the SQL necessary to define an index for a specific database engine.

Parameters
Name Type Description
$class string

The name of the class the index is defined for.

$name string

The name of the index.

$meta string

The metadata defining the index.

$options array

An array of options for the process.

Returns
Type Description
string A string of SQL representing the index definition.
methodpublicgetTransport( ) : void

Gets a data transport mechanism for this xPDOManager instance.

methodpublicremoveConstraint( string $class, string $name, array $options = array() ) : boolean
abstract

Remove a constraint from an object container, e.g. DROP CONSTRAINT.

Parameters
Name Type Description
$class string

The object class to drop the constraint from.

$name string

The name of the constraint to drop.

$options array

An array of options for the process.

Returns
Type Description
boolean True if the constraint is dropped successfully, otherwise false.
methodpublicremoveField( string $class, string $name, array $options = array() ) : boolean
abstract

Remove a field from an object container, e.g. DROP COLUMN.

Parameters
Name Type Description
$class string

The object class to drop the field from.

$name string

The name of the field to drop.

$options array

An array of options for the process.

Returns
Type Description
boolean True if the column is dropped successfully, otherwise false.
methodpublicremoveIndex( string $class, string $name, array $options = array() ) : boolean
abstract

Remove an index from an object container, e.g. DROP INDEX.

Parameters
Name Type Description
$class string

The object class to drop the index from.

$name string

The name of the index to drop.

$options array

An array of options for the process.

Returns
Type Description
boolean True if the index is dropped successfully, otherwise false.
methodpublicremoveObjectContainer( string $className ) : boolean
abstract

Drop an object container (i.e. database table), if it exists.

Parameters
Name Type Description
$className string

The object container to drop.

Returns
Type Description
boolean Returns true on successful drop, false on failure.
methodpublicremoveSourceContainer(  $dsnArray = null, string $username = null, string $password = null ) : boolean
abstract

Drops a physical data source container, if it exists.

Parameters
Name Type Description
$dsnArray
$username string

Database username with privileges to drop tables.

$password string

Database user password.

Returns
Type Description
boolean Returns true on successful drop, false on failure.
Documentation was generated by DocBlox 0.18.1.