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

Class: DB_DataObject_Generator

Source Location: /DB_DataObject-1.11.2/DB/DataObject/Generator.php

Class Overview

DB_DataObject_Overload
   |
   --DB_DataObject
      |
      --DB_DataObject_Generator

Generator class


Methods


Inherited Variables

Inherited Methods

Class: DB_DataObject

DB_DataObject::autoJoin()
autoJoin - using the links.ini file, it builds a query with all the joins
DB_DataObject::count()
Find the number of results from a simple query
DB_DataObject::database()
Return or assign the name of the current database
DB_DataObject::databaseStructure()
Autoload or manually load the table definitions
DB_DataObject::debug()
Debugger. - use this in your extended classes to output debugging information.
DB_DataObject::debugLevel()
sets and returns debug level eg. DB_DataObject::debugLevel(4);
DB_DataObject::delete()
Deletes items from table which match current objects variables
DB_DataObject::escape()
an escape wrapper around DB->escapeSimple() can be used when adding manual queries or clauses eg.
DB_DataObject::fetch()
fetches next row into this objects var's
DB_DataObject::fetchAll()
fetches all results as an array,
DB_DataObject::fetchRow()
fetches a specific row into this object variables
DB_DataObject::find()
find results, either normal or crosstable
DB_DataObject::free()
Free global arrays associated with this object.
DB_DataObject::fromValue()
standard set* implementation.
DB_DataObject::get()
Get a result using key, value.
DB_DataObject::getDatabaseConnection()
Gets the DB object related to an object - so you can use funky peardb stuf with it :)
DB_DataObject::getDatabaseResult()
Gets the DB result object related to the objects active query
  • so you can use funky pear stuff with it - like pager for example.. :)
DB_DataObject::getLink()
deprecited : @use link()
DB_DataObject::getLinkArray()
getLinkArray Fetch an array of related objects. This should be used in conjunction with a <dbname>.links.ini file configuration (see the introduction on linking for details on this).
DB_DataObject::getLinks()
load related objects
DB_DataObject::groupBy()
Adds a group by condition
DB_DataObject::having()
Adds a having clause
DB_DataObject::insert()
Insert the current objects variables into the database
DB_DataObject::joinAdd()
joinAdd - adds another dataobject to this, building a joined query.
DB_DataObject::keys()
get/set an array of table primary keys
DB_DataObject::limit()
Sets the Limit
DB_DataObject::link()
generic getter/setter for links
DB_DataObject::links()
Get the links associate array as defined by the links.ini file.
DB_DataObject::orderBy()
Adds a order by condition
DB_DataObject::pid()
Get the value of the primary id
DB_DataObject::query()
sends raw query to database
DB_DataObject::raiseError()
Default error handling is to create a pear error, but never return it.
DB_DataObject::selectAdd()
Adds a select columns
DB_DataObject::selectAs()
Adds multiple Columns or objects to select with formating.
DB_DataObject::sequenceKey()
get/set an sequence key
DB_DataObject::setFrom()
Copies items that are in the table definitions from an array or object into the current object will not override key values.
DB_DataObject::sqlValue()
Factory method for calling DB_DataObject_Cast
DB_DataObject::staticGet()
(deprecated - use ::get / and your own caching method)
DB_DataObject::table()
get/set an associative array of table columns
DB_DataObject::tableName()
Return or assign the name of the current table
DB_DataObject::toArray()
Returns an associative array from the current data (kind of oblivates the idea behind DataObjects, but is usefull if you use it with things like QuickForms.
DB_DataObject::toValue()
standard get* implementation.
DB_DataObject::unionAdd()
unionAdd - adds another dataobject to this, building a unioned query.
DB_DataObject::update()
Updates current objects variables into the database uses the keys() to decide how to update Returns the true on success
DB_DataObject::validate()
validate the values of the object (usually prior to inserting/updating..)
DB_DataObject::whereAdd()
Adds a condition to the WHERE statement, defaults to AND
DB_DataObject::whereAddIn()
Adds a 'IN' condition to the WHERE statement
DB_DataObject::_call()
Overload Extension support
  • enables setCOLNAME/getCOLNAME
if you define a set/get method for the item it will be called.
DB_DataObject::_loadConfig()
Define the global $_DB_DATAOBJECT['CONFIG'] as an alias to PEAR::getStaticProperty('DB_DataObject','options');

Class: DB_DataObject_Overload

DB_DataObject_Overload::__call()
DB_DataObject_Overload::__sleep()

Class Details

[line 59]
Generator class


[ Top ]


Method Detail

derivedHookClassDocBlock   [line 1255]

string derivedHookClassDocBlock( )

hook to add extra class level DocBlock (in terms of phpDocumentor)

called once for each class, use it add extra comments to class string (require_once...)

  • Return: added to class eg. functions.
  • Access: public

[ Top ]

derivedHookExtendsDocBlock   [line 1243]

string derivedHookExtendsDocBlock( )

hook to add extra doc block (in terms of phpDocumentor) to extend string

called once for each class, use it add extra comments to extends string (require_once...)

  • Return: added to class eg. functions.
  • Access: public

[ Top ]

derivedHookFunctions   [line 1186]

string derivedHookFunctions( [ $input = ""])

hook to add extra methods to all classes

called once for each class, use with $this->table and $this->_definitions[$this->table], to get data out of the current table, use it to add extra methods to the default classes.

  • Return: added to class eg. functions.
  • Access: public

Parameters:

   $input     

[ Top ]

derivedHookPageLevelDocBlock   [line 1231]

string derivedHookPageLevelDocBlock( )

hook to add extra page-level (in terms of phpDocumentor) DocBlock

called once for each class, use it add extra page-level docs

  • Return: added to class eg. functions.
  • Access: public

[ Top ]

derivedHookPostVar   [line 1218]

string derivedHookPostVar( array $t)

hook for after var lines ( called at the end of the output of var line have generated, override to add extra var lines
  • Return: added to class eg. functions.
  • Access: public

Parameters:

array   $t     cols containing array of objects with type,len,flags etc. from tableInfo call

[ Top ]

derivedHookVar   [line 1203]

string derivedHookVar( object t &$t, int $padding)

hook for var lines called each time a var line is generated, override to add extra var lines
  • Return: added to class eg. functions.
  • Access: public

Parameters:

object t   &$t     containing type,len,flags etc. from tableInfo call
int   $padding     padding number of spaces

[ Top ]

fillTableSchema   [line 1308]

none fillTableSchema( string $database, string $table)

fillTableSchema - set the database schema on the fly
  • Return: | PEAR::error()
  • Access: public

Parameters:

string   $database     database name
string   $table     table name of table to create schema info for

[ Top ]

generateClasses   [line 892]

void generateClasses( )


[ Top ]

generateForeignKeys   [line 512]

void generateForeignKeys( )

generate Foreign Keys (for links.ini) Currenly only works with mysql / mysqli to use, you must set option: generate_links=true
  • Author: Pascal Schöni

[ Top ]

getClassNameFromTableName   [line 834]

string getClassNameFromTableName( $table)

Convert a table name into a class name -> override this if you want a different mapping
  • Return: class name;
  • Access: public

Parameters:

   $table     

[ Top ]

getFileNameFromTableName   [line 850]

string getFileNameFromTableName( $table)

Convert a table name into a file name -> override this if you want a different mapping
  • Return: file name;
  • Access: public

Parameters:

   $table     

[ Top ]

getMethodNameFromColumnName   [line 880]

string getMethodNameFromColumnName( $col)

Convert a column name into a method name (usually prefixed by get/set/validateXXXXX)
  • Return: method name;
  • Access: public

Parameters:

   $col     

[ Top ]

getProxyFull   [line 1274]

object Instance getProxyFull( string $database, string $table)

getProxyFull - create a class definition on the fly and instantate it..

similar to generated files - but also evals the class definitoin code.

  • Return: of class. or PEAR Error
  • Access: public

Parameters:

string   $database     database name
string   $table     table name of table to create proxy for.

[ Top ]

start   [line 103]

none start( )

The 'starter' = call this to start the process
  • Access: public

[ Top ]

_generateDefaultsFunction   [line 1706]

string _generateDefaultsFunction( array $table, $defs)

Generate defaults Function - used generator_add_defaults or generator_no_ini is set.

Only supports mysql and mysqli ... welcome ideas for more..

  • Access: public

Parameters:

array   $table     table and key definition.
   $defs     

[ Top ]

_generateGetters   [line 1395]

string _generateGetters( string $input)

Generate getter methods for class definition
  • Access: public

Parameters:

string   $input     Existing class contents

[ Top ]

_generateKeysFunction   [line 1600]

string _generateKeysFunction( array $def)

Generate keys Function - used generator_no_ini is set.
  • Access: public

Parameters:

array   $def     keys array.

[ Top ]

_generateLinkMethods   [line 1446]

string _generateLinkMethods( string $input)

Generate link setter/getter methods for class definition
  • Access: public

Parameters:

string   $input     Existing class contents

[ Top ]

_generateSequenceKeyFunction   [line 1626]

string _generateSequenceKeyFunction( array $def)

Generate sequenceKey Function - used generator_no_ini is set.
  • Access: public

Parameters:

array   $def     table and key definition.

[ Top ]

_generateSetters   [line 1515]

string _generateSetters( string $input)

Generate setter methods for class definition
  • Access: public

Parameters:

string   $input     Existing class contents

[ Top ]

_generateTableFunction   [line 1565]

string _generateTableFunction( array $def)

Generate table Function - used when generator_no_ini is set.
  • Access: public

Parameters:

array   $def     table array.

[ Top ]


Documentation generated on Fri, 05 Apr 2013 09:00:15 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.