Sitellite Application Framework
Class Tree         Index         All Elements

Class: PgSQL_DatabaseTable

Source Location: Program_Root/Database/Driver/PgSQL.php

Class Overview

DatabaseTable
   |
   --PgSQL_DatabaseTable

PgSQL_DatabaseTable provides all of the PgSQL-specific functionality for the saf.Database.Table package.


Author(s)

Version

  • 1.0, 2002-08-07, $Id: PgSQL.php,v 1.2 2005/07/06 15:30:56 lux Exp $

Copyright

  • Copyright (C) 2001-2003, Simian Systems Inc.

Variables

Methods


Inherited Variables

Inherited Methods

Class: DatabaseTable

DatabaseTable::DatabaseTable()
Constructor method.
DatabaseTable::addFacet()
Creates a "facet" about this widget based on one of its columns. See saf.Database.Facet for more info about those.
DatabaseTable::changeType()
PLEASE NOTE: This method is deprecated in favour of the built-in changeType() method in the base MF_Widget class.
DatabaseTable::delete()
Creates an DELETE query from the key value or values provided.
DatabaseTable::fetch()
Creates a SELECT query based on the key given to it.
DatabaseTable::fetchAll()
Creates a SELECT query without a WHERE clause, returning all columns from the table. $columns is an optional array of columns to return. $ascdesc can be either 'asc' or 'desc'. Returns an array of objects, or false on failure.
DatabaseTable::getInfo()
Gets all the info it can from the database about this table and
DatabaseTable::getPkey()
Gets the name of the primary key field for this table using the results of getInfo() (see below). Used by the constructor method to set the $pkey property if a primary key column was not specified.
DatabaseTable::getRefInfo()
Uses the global $tables array (Sitellite CMS specific) to get
DatabaseTable::insert()
Creates an INSERT query from the columns provided. Returns the lastid() of the query, or the $columns[$this->pkey] value if there is no sequential key in this table, or false on failure.
DatabaseTable::update()
Creates an UPDATE query from the $keyval and $columns provided.

Class Details

[line 561]
PgSQL_DatabaseTable provides all of the PgSQL-specific functionality for the saf.Database.Table package.


1 <?php
2
3 $dt = new PgSQL_DatabaseTable ($db, 'tablename', 'pkeycolumn');
4
5 if ($res = $dt->fetchAll ()) {
6 // do something with $res
7 } else {
8 echo $dt->error;
9 }
10
11 ?>




Tags:

access:  public
version:  1.0, 2002-08-07, $Id: PgSQL.php,v 1.2 2005/07/06 15:30:56 lux Exp $
license:  http://www.sitellite.org/index/license
copyright:  Copyright (C) 2001-2003, Simian Systems Inc.
author:  John Luxford <mailto:lux@simian.ca>


[ Top ]


Class Variables

$typemap = array (
      'bpchar'               => 'text',
      'char'                  => 'text',
      'varchar'               => 'text',
      'text'                  => 'textarea',

      'date'                  => 'date',
      'time'                  => 'time',
      'timestamp'               => 'datetime',
      '.*'                  => 'text',

                     )

[line 570]

Contains a key/value list of database types (regular expressions are used here to save repeating ourselves) and their corresponding MailForm widget types.



Tags:

access:  public

Type:   mixed
Overrides:   Array


[ Top ]



Class Methods


method getInfo [line 595]

boolean getInfo( )

Gets all the info it can from the database about this table and its columns, stores it in the $info property, and parses it into an associative array ($columns) of MailForm widgets.



Tags:

access:  public


Overrides DatabaseTable::getInfo() (Gets all the info it can from the database about this table and)

[ Top ]

method getPkey [line 656]

string getPkey( )

Gets the name of the primary key field for this table using the results of getInfo() (see below). Used by the constructor method to set the $pkey property if a primary key column was not specified.

Returns false on failure.




Tags:

access:  public


Overrides DatabaseTable::getPkey() (Gets the name of the primary key field for this table using the results of getInfo() (see below). Used by the constructor method to set the $pkey property if a primary key column was not specified.)

[ Top ]

method getRefInfo [line 690]

boolean getRefInfo( string $name, string $table)

Uses the global $tables array (Sitellite CMS specific) to get the primary key, referencing column, display column, and a true or false self-reference value, when given a Ref column name and its corresponding table.



Tags:

access:  public


Overrides DatabaseTable::getRefInfo() (Uses the global $tables array (Sitellite CMS specific) to get)

Parameters:

string   $name  
string   $table  

[ Top ]


Copyright © 2007, SIMIAN systems Inc.
All rights reserved. Privacy policy
Documentation generated on Tue, 13 Feb 2007 17:18:39 -0600 by Sitellite AppDoc and phpDocumentor 1.2.2