core/xpdo/om/sqlsrv/xpdomanager.class.php

Show: inherited
Table of Contents

The sqlsrv implementation of the xPDOManager class.

Package
xpdo  
Subpackage
om.sqlsrv  

\xPDOManager_sqlsrv

Package: xpdo\om\sqlsrv

Provides sqlsrv 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 this instance is implemented for sqlsrv.

Parent(s)
\xPDOManager

Properties

Propertypublic\xPDOGenerator  $generator= 'null'
inherited

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

The data transport class for migrating data.Inherited from: \xPDOManager::$$transport
Default valuenullDetails
Type
\xPDOTransport
Inherited_from
\xPDOManager::$$transport  
Propertypublic\xPDO  $xpdo= 'null'
inherited

A reference to the XPDO instance using this manager.Inherited from: \xPDOManager::$$xpdo
Default valuenullDetails
Type
\xPDO
Access
public  
Inherited_from
\xPDOManager::$$xpdo  

Methods

methodpublic__construct( object $xpdo ) : void
inherited

Get a xPDOManager instance.

Inherited from: \xPDOManager::__construct()
Parameters
Name Type Description
$xpdo object

A reference to a specific modDataSource instance.

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

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

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

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

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

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

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

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

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.
methodprivategetDefaultConstraints(  $class,  $name,  $options = array() ) : void

Parameters
Name Type Description
$class
$name
$options
methodpublicgetGenerator( ) : \xPDOGenerator
inherited

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

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

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
inherited

Gets a data transport mechanism for this xPDOManager instance.

Inherited from: \xPDOManager::getTransport()
methodpublicremoveConstraint( string $class, string $name, array $options = array() ) : boolean

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

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

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

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

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.