yana

Description
  Class trees
  Index of elements
  Todo List
core
  Classes
    FormCreator
    Index
    Language
    Object
    Plugin
    PluginManager
    Singleton
    SmartTemplate
    SmartView
    Utility
    Yana
database
  Classes
    DbBlob
    DbCreator
    DbDesigner4
    DbExtractor
    DbQuery
    DbQueryParser
    DbServer
    DbStream
    DbStructure
    FileDb
error_reporting
  Classes
    Alert
    Error
    ErrorUtility
    Log
    Message
    Report
    Warning
file_system
  Classes
    DatFile
    Dir
    Executeable
    File
    FileReadonly
    FileSystemResource
    SML
javascript
  Classes
    AjaxRequest
  Functions
    preview
    yanaAddEventListener
    yanaAddIcon
    yanaCheckEmbTags
    yanaCloseAll
    yanaGetCookie
    yanaGetElementsByClassName
    yanaMaxLength
    yanaMenu
    yanaMenuCookie
    yanaSetCookie
mail
  Classes
    FormMailer
    Mailer
plugins
  Classes
    plugin_blog
    plugin_check
    plugin_db_admin
    plugin_db_tools
    plugin_default_library
    plugin_diagnostics
    plugin_guestbook
    plugin_guestbook_admin
    plugin_ipblock
    plugin_ipblock_admin
    plugin_rss
    plugin_rss_admin
    plugin_sdk
    plugin_search
    plugin_search_admin
    plugin_user
    plugin_user_admin
utilities
  Classes
    Brush
    Counter
    Hashtable
    Image
    Microsummary
    RSS
    RSSitem
    String
  Functions
    checkArgumentList
    cloneArray
    dirlist
    qSearchArray
    untaintInput
    XMLencode
vdrive
  Classes
    Registry
    VDrive
zip
  Classes
    PclZip

phpDocumentor v 1.4.0

YANA Framework for PHPDocs For Class DbCreator

### Class DbCreator

#### Description

«decorator» database Creator
This decorator class is intended to create SQL DDL (data definition language) from YANA Framework - database structure files.
For this task it provides functions which create specific DDL for various DBS.

- since: 2.8.6
- access: public

    Object
       |
       --DbCreator

##### Method Summary

- DbCreator DbCreator (string|DbStructure &$structure)
- array createDB2 ()
- array createMSAccess ()
- array createMSSQL ()
- array createMySQL ()
- array createOracleDB ()
- array createPostgreSQL ()
- DbStructure getStructure ()
- bool setStructure (string|DbStructure &$structure)

#### Direct descendents

Class | Description
--- | ---
DbExtractor | «decorator» database Extractor

#### Methods

##### create a new instance

DbCreator DbCreator (
string|DbStructure &$structure
)

###### List of parameters:

Name | Type | Description
--- | --- | ---
&$structure | string|DbStructure | a structure resource

###### Description:

This class requires an object of class DbStructure as input.
Example of usage:

1. // create new instance of this class
2. $dbc = new DbCreator( new DbStructure('guestbook'));
3. // since version 2.9.6 you may also write
4. $db = 'guestbook';
5. $dbc = new DbCreator($db);
6. // create SQL DDL (here: using MySQL syntax)
7. $arrayOfStmts = $dbc->createMySQL();
8. // This will output the result as text
9. print implode("\n", $arrayOfStmts);
10. // This will send the statements to the database
11. $db = new DbStream('guestbook');
12. foreach ($arrayOfStmts as $stmt)
13. {
14. $db->query($stmt);
15. }

##### create SQL for IBM DB2

array createDB2 ()

###### Description:

Returns a numeric array of SQL statements. Each element is a single statement. If you want to send the result to a SQL file you should "implode()" the array to a string.

- access: public

Redefined in descendants as:

- DbExtractor::createDB2() : create SQL for IBM DB2

##### create SQL for MS Access

array createMSAccess ()

###### Description:

Same as DbCreator::createMSSQL()

- see: DbCreator::createMSSQL()
- access: public

Redefined in descendants as:

- DbExtractor::createMSAccess() : create SQL for MS Access

##### create SQL for MS SQL Server

array createMSSQL ()

###### Description:

Returns a numeric array of SQL statements. Each element is a single statement. If you want to send the result to a SQL file you should "implode()" the array to a string.

- access: public

Redefined in descendants as:

- DbExtractor::createMSSQL() : create SQL for MS SQL Server

##### create SQL for MySQL

array createMySQL ()

###### Description:

Returns a numeric array of SQL statements. Each element is a single statement. If you want to send the result to a SQL file you should "implode()" the array to a string.

- access: public

Redefined in descendants as:

- DbExtractor::createMySQL() : create SQL for MySQL

##### create SQL for Oracle

array createOracleDB ()

###### Description:

Returns a numeric array of SQL statements. Each element is a single statement. If you want to send the result to a SQL file you should "implode()" the array to a string.

- access: public

Redefined in descendants as:

- DbExtractor::createOracleDB() : create SQL for Oracle

##### create SQL for PostgreSQL

array createPostgreSQL ()

###### Description:

Returns a numeric array of SQL statements. Each element is a single statement. If you want to send the result to a SQL file you should "implode()" the array to a string.

- access: public

Redefined in descendants as:

- DbExtractor::createPostgreSQL() : create SQL for PostgreSQL

##### get the currently set structure file

DbStructure getStructure ()

###### Description:

Returns an instance of {link DbStructure}. You can query this object for details on the structure of the currently selected database.

- since: 2.9.6
- access: public

##### set a new structure file

bool setStructure (
string|DbStructure &$structure
)

###### List of parameters:

Name | Type | Description
--- | --- | ---
&$structure | string|DbStructure |

###### Description:

The argument $structure may either be a reference to an instance of class DbStructure, or a string, which contains the name of a database. The database must be registered in the framework. If so, this function may find the corresponding structure file automatically.
Returns bool(true) on success or bool(false) on error.

- since: 2.9.6
- access: public

##### inherited from base classes

Inherited From Object

- Object::cloneObject()
- Object::equals()
- Object::getClass()
- Object::serialize()
- Object::toString()

Documentation generated on Sun, 04 Jan 2009 03:48:49 +0100 by phpDocumentor 1.4.0

yana author: Thomas Meyerwww.yanaframework.net