VCL
[ class tree: VCL ] [ index: VCL ] [ all elements ]

Class: CustomConnection

Source Location: /db.inc.php

Class Overview

Object
   |
   --Persistent
      |
      --Component
         |
         --CustomConnection

CustomConnection, a common ancestor for all Connection objects


Variables

Methods


Child classes:

Database
Database provides discrete control over a connection to a single database in a database application.
IBDatabase
IBDatabase provides discrete control over a connection to a single InterBase database in a database application.
MySQLDatabase
MySQLDatabase provides discrete control over a connection to a single MySQL database in a database application.
OracleDatabase
OracleDatabase provides discrete control over a connection to a single Oracle database in a database application.

Inherited Variables

Inherited Methods

Class: Component

Component::__construct()
Component constructor
Component::ajaxCall()
Dumps the javascript code to make an ajax call to the server.
Component::callEvent()
Calls a server event.
Component::defaultName()
Component::defaultTag()
Component::dumpChildrenFormItems()
This method is called by the page just after dumping the starting form tag.
Component::dumpChildrenHeaderCode()
Dumps the header code for all the children
Component::dumpChildrenJavascript()
Dumps the javascript code for all the children
Component::dumpFormItems()
Dumps code just after the form tag, useful to dump hidden fields for state retrieving for non visible components
Component::dumpHeaderCode()
Dumps header code required
Component::dumpHiddenKeyFields()
Dumps hidden field values for the key record
Component::dumpJavascript()
Dumps the javascript code needed by this component
Component::dumpJSEvent()
Dumps javascript code for an event
Component::fixupProperty()
Resolves the right reference to an object property
Component::generateAjaxEvent()
Returns the javascript code to generate an ajax call.
Component::getName()
Specifies the name for the component. The name is used as an identifier and should be unique.
Component::getTag()
A versatile property of every Component that can be used in any way you want
Component::hasValidDataField()
Returns true if a valid data field is attached to the component
Component::init()
Initializes a component
Component::insertComponent()
Inserts a component into the component's collection
Component::loaded()
Initializes the component after the form file has been read into memory.
Component::loadedChildren()
Calls childrens loaded
Component::loadResource()
Loads this component from a string
Component::preinit()
Method called before init()
Component::readAccessibility()
Provides accessibility info to the embedded RPC engine.
Component::readComponentCount()
Indicates the number of components owned by the component.
Component::readComponents()
Lists all the components owned by this component.
Component::readControlState()
A flag to know the state of the control, csLoading, csDesigning
Component::readDataFieldValue()
This property returns the value of the datafield if any.
Component::readFromResource()
Reads a component from a resource file
Component::readNamePath()
Specifies the path to uniquely identify a component, qualified by the owner when required.
Component::readOwner()
Indicates the component that is responsible for streaming and freeing this component.
Component::removeComponent()
Removes a component from the component's collection
Component::serializeChildren()
Serializes all children
Component::setName()
Component::setTag()
Component::unserializeChildren()
Unserializes all children by calling unserialize for all the components
Component::updateDataField()
Updates the field on the dataset attached, if any
Component::writeControlState()

Class: Persistent

Persistent::allowserialize()
This method provides an opportunity for the component developer to prevent the serialization/unserialization of a property.
Persistent::assign()
Assigns the source properties to this object.
Persistent::assignError()
Raises an assignation error.
Persistent::assignTo()
Assigns this object to another object.
Persistent::inSession()
This method determines if this object exists in the current session.
Persistent::readNamePath()
Used to serialize/unserialize. It returns the full path to identify this component.
Persistent::readOwner()
Owner of the component.
Persistent::serialize()
Stores this object into the session.
Persistent::unserialize()
This method uses PHP reflection to iterate through published properties (the ones starting with get) and retrieve the properties stored by a previous serialize() call.

Class: Object

Object::__construct()
Constructs an object and initializes its data before the object is first used.
Object::className()
Returns a string indicating the type of the object instance (as opposed to the type of the variable passed as an argument).
Object::classNameIs()
Determines whether an object is of a specific type.
Object::classParent()
Returns the type of the immediate ancestor of a class.
Object::inheritsFrom()
Determines the relationship of two object types.
Object::methodExists()
Check if a method exists declared on this object instance.
Object::readProperty()
Reads a property from the streams
Object::__get()
To virtualize properties
Object::__set()
To virtualize properties

Class Details

[line 79]
CustomConnection, a common ancestor for all Connection objects

A connection must represent the object which through data objects (tables, queries, etc) perform their operations. Components like Database inherit from CustomConnection and implement the right functionality.




[ Top ]


Class Variables

$_clients = null

[line 97]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_datasets = null

[line 82]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_fstreamedconnected = false

[line 83]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_onafterconnect = null

[line 257]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_onafterdisconnect = null

[line 297]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_onbeforeconnect = null

[line 274]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_onbeforedisconnect = null

[line 313]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_oncustomconnect = null

[line 291]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_onlogin = null

[line 329]



Tags:

access:  protected

Type:   mixed


[ Top ]



Class Methods


constructor __construct [line 348]

CustomConnection __construct( [ $aowner = null])



Overridden in child classes as:

Database::__construct()
IBDatabase::__construct()
MySQLDatabase::__construct()
OracleDatabase::__construct()

Overrides Component::__construct() (Component constructor)

Parameters:

   $aowner  

[ Top ]

method BeginTrans [line 124]

void BeginTrans( )

Begins a new transaction against the database server.

Call BeginTrans to begin a new transaction against the database server.

Updates, insertions, and deletions that take place after a call to StartTransaction are held by the server until an application calls CompleteTrans with true to commit the changes or false to Rollback




Tags:

see:  completeTrans()


Overridden in child classes as:

Database::BeginTrans()
MySQLDatabase::BeginTrans()
OracleDatabase::BeginTrans()

[ Top ]

method Close [line 380]

void Close( )

Closes the connection.

Call Close to disconnect from the remote source of database information. Before the connection component is deactivated, all associated datasets are closed. Calling Close is the same as setting the Connected property to false.




Tags:



[ Top ]

method CompleteTrans [line 150]

bool CompleteTrans( [bool $autocomplete = true])

Permanently stores updates, insertions, and deletions of data associated with

the current transaction, and ends the current transactions, but if false is sent in the autocomplete parameter, then a rollback is performed and then Cancels all updates, insertions, and deletions for the current transaction and ends the transaction.

Call CompleteTrans to permanently store to the database server all updates, insertions, and deletions of data associated with the current transaction and then end the transaction. The current transaction is the last transaction started by calling BeginTrans.

If you send false on the autocomplete parameter, then it cancels all updates, insertions, and deletions for the current transaction and to end the transaction. The current transaction is the last transaction started by calling BeginTrans.




Tags:

see:  beginTrans()


Overridden in child classes as:

Database::CompleteTrans()
MySQLDatabase::CompleteTrans()
OracleDatabase::CompleteTrans()

Parameters:

bool   $autocomplete   If true, the transaction will be commited, if false, will be rolled back

[ Top ]

method DBDate [line 190]

string DBDate( string $input)

Returns a date formatted to be used on this database, depending on the type

You must use this method to get a data formatted in a valid format depending on the type of database.




Tags:

return:  Date converted to a valid format
see:  param(), quoteStr()


Overridden in child classes as:

Database::DBDate()
MySQLDatabase::DBDate()
OracleDatabase::DBDate()

Parameters:

string   $input   Date to convert

[ Top ]

method defaultClients [line 255]

void defaultClients( )



[ Top ]

method defaultConnected [line 445]

void defaultConnected( )



[ Top ]

method defaultDataSets [line 95]

void defaultDataSets( )



[ Top ]

method defaultOnAfterConnect [line 272]

void defaultOnAfterConnect( )



[ Top ]

method defaultOnAfterDisconnect [line 311]

void defaultOnAfterDisconnect( )



[ Top ]

method defaultOnBeforeConnect [line 289]

void defaultOnBeforeConnect( )



[ Top ]

method defaultOnBeforeDisconnect [line 327]

void defaultOnBeforeDisconnect( )



[ Top ]

method defaultOnCustomConnect [line 295]

void defaultOnCustomConnect( )



[ Top ]

method defaultOnLogin [line 346]

void defaultOnLogin( )



[ Top ]

method DoConnect [line 457]

void DoConnect( )

Provides the interface for a method that opens a connection.

The Connected property uses DoConnect to establish a connection. Descendant classes override the DoConnect method to establish their connection as appropriate. As implemented in CustomConnection, DoConnect does nothing.




Tags:

see:  open(), close(), CustomConnection::readConnected()


Overridden in child classes as:

Database::DoConnect()
MySQLDatabase::DoConnect()
OracleDatabase::DoConnect()

[ Top ]

method DoDisconnect [line 471]

void DoDisconnect( )

Provides the interface for a method that terminates the connection.

The Connected property uses DoDisconnect to close a connection. Descendant classes override the DoDisconnect method to drop a connection. As implemented in CustomConnection, DoDisconnect does nothing.




Tags:

see:  open(), close(), CustomConnection::readConnected()


Overridden in child classes as:

Database::DoDisconnect()
MySQLDatabase::DoDisconnect()
OracleDatabase::DoDisconnect()

[ Top ]

method getOnCustomConnect [line 293]

void getOnCustomConnect( )



[ Top ]

method loaded [line 386]

void loaded( )



Overrides Component::loaded() (Initializes the component after the form file has been read into memory.)

[ Top ]

method MetaFields [line 109]

array MetaFields( string $tablename)

Returns the fieldnames for the table

Use this method to get an array with the fieldnames for an specific table. This method can be useful if you want to explore the structure of a table.




Tags:

return:  Array with fieldnames for $tablename


Overridden in child classes as:

Database::MetaFields()
MySQLDatabase::MetaFields()
OracleDatabase::MetaFields()

Parameters:

string   $tablename   Table to get the fields for

[ Top ]

method Open [line 365]

void Open( )

Opens the connection.

Call Open to establish a connection to the remote source of database information. Open sets the Connected property to true.




Tags:



[ Top ]

method Param [line 225]

string Param( string $input)

Returns a parameter formatted depending on the database type

When writting parametrized queries, use this method to get a parameter formatted in a valid format for the current database type.




Tags:

return:  converted to a valid parameter
see:  CustomConnection::DBDate(), CustomConnection::QuoteStr()


Overridden in child classes as:

Database::Param()
MySQLDatabase::Param()
OracleDatabase::Param()

Parameters:

string   $input   Parameter name

[ Top ]

method Prepare [line 209]

void Prepare( string $query)

Sends a query to the server for optimization prior to execution.

Call Prepare to have a remote database server allocate resources for the query and to perform additional optimizations.

If the query will only be executed once, the application does not need to explicitly call Prepare. Executing an unprepared query generates these calls automatically. However, if the same query is to be executed repeatedly, it is more efficient to prevent these automatic calls by calling Prepare explicitly.




Overridden in child classes as:

Database::Prepare()
MySQLDatabase::Prepare()
OracleDatabase::Prepare()
Prepares a query to be executed and performs parameter optimizations

Parameters:

string   $query   SQL sentence to be prepared

[ Top ]

method QuoteStr [line 241]

string QuoteStr( string $input)

Quote a string depending on the database type

When writting queries, use this method to get a string quoted in a format valid for the current database type.




Tags:

return:  quoted with valid quotes
see:  param(), dbDate()


Overridden in child classes as:

Database::QuoteStr()
MySQLDatabase::QuoteStr()
OracleDatabase::QuoteStr()

Parameters:

string   $input   String to quote

[ Top ]

method readClients [line 253]

Collection readClients( )

Returns the clients of this database



Tags:

see:  readDatasets()


[ Top ]

method readConnected [line 414]

boolean readConnected( )

Determines whether a connection has been established to the remote source of data.

Set Connected to true to open the connection. Set Connected to false to terminate the connection.

Setting Connected to true generates a OnBeforeConnect event, calls the protected DoConnect method to establish the connection, and generates an OnAfterConnect event. In addition, when setting Connected to true.

Setting Connected to false generates a OnBeforeDisconnect event, calls the protected DoConnect method to drop the connection, and generates an OnAfterDisconnect event.

When deriving custom connection components from CustomConnection, override readConnected to return true when a connection is established, and override DoConnect and DoDisconnect to create and drop the connection.




Tags:



Overridden in child classes as:

Database::readConnected()
Specifies if the database is connected or not
IBDatabase::readConnected()
MySQLDatabase::readConnected()
OracleDatabase::readConnected()

[ Top ]

method readDataSets [line 93]

Collection readDataSets( )

Provides an indexed array of all active datasets for a database component.

Use DataSets to access active datasets associated with a database component. An active dataset is one that is currently open.




Tags:



[ Top ]

method readOnAfterConnect [line 270]

mixed readOnAfterConnect( )

Occurs after a connection is established.

Write an OnAfterConnect event handler to take application-specific actions immediately after the connection component opens a connection to the remote source of database information.




Tags:



[ Top ]

method readOnAfterDisconnect [line 309]

mixed readOnAfterDisconnect( )

Occurs after the connection closes.

Write an OnAfterDisconnect event handler to take application-specific actions after the connection component drops a connection.




Tags:



[ Top ]

method readOnBeforeConnect [line 287]

mixed readOnBeforeConnect( )

Occurs immediately before establishing a connection.

Write a OnBeforeConnect event handler to take application-specific actions before the connection component opens a connection to the remote source of database information.




Tags:



[ Top ]

method readOnBeforeDisconnect [line 325]

mixed readOnBeforeDisconnect( )

Occurs immediately before the connection closes.

Write a BeforeDisconnect event handler to take application-specific actions before dropping a connection.




Tags:



[ Top ]

method readOnLogin [line 344]

mixed readOnLogin( )

Occurs when an application connects to a database.

Write an OnLogin event handler to take specific actions when an application attempts to connect to a database.

If there is no OnLogin event handler, the current UserName and Password are the ones used from the UserName and UserPassword properties.

These values are then passed to the remote server.




[ Top ]

method SendConnectEvent [line 167]

void SendConnectEvent( $connecting $connecting)

Send a connect event to all the datasets, both for connecting and disconnecting

This is an internal method used to fire a dataset connect event to all attached datasets.




Tags:



Parameters:

$connecting   $connecting   boolean specifies the status of the connection

[ Top ]

method setOnCustomConnect [line 294]

void setOnCustomConnect( $value)



Parameters:

   $value  

[ Top ]

method writeClients [line 254]

void writeClients( $value)



Parameters:

   $value  

[ Top ]

method writeConnected [line 415]

void writeConnected( $value)



Parameters:

   $value  

[ Top ]

method writeDataSets [line 94]

void writeDataSets( $value)



Parameters:

   $value  

[ Top ]

method writeOnAfterConnect [line 271]

void writeOnAfterConnect( $value)



Parameters:

   $value  

[ Top ]

method writeOnAfterDisconnect [line 310]

void writeOnAfterDisconnect( $value)



Parameters:

   $value  

[ Top ]

method writeOnBeforeConnect [line 288]

void writeOnBeforeConnect( $value)



Parameters:

   $value  

[ Top ]

method writeOnBeforeDisconnect [line 326]

void writeOnBeforeDisconnect( $value)



Parameters:

   $value  

[ Top ]

method writeOnLogin [line 345]

void writeOnLogin( $value)



Parameters:

   $value  

[ Top ]


Documentation generated on Sat, 13 Jun 2009 10:51:22 -0700 by phpDocumentor 1.4.1