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

Class: MDB2_TableBrowser_Single

Source Location: /MDB2_TableBrowser-0.1.3/MDB2/TableBrowser/Single.php

Class Overview


This class implements the SingleTableBrowser interface


Author(s):

Version:

  • Release: <package_version>

Copyright:

  • 2007-2012 Isaac Tewolde

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 36]
This class implements the SingleTableBrowser interface


[ Top ]


Class Variables

$columnManager =

[line 57]

  • Access: protected

Type:   mixed


[ Top ]

$distinct =  false

[line 48]

  • Access: protected

Type:   mixed


[ Top ]

$filterManager =

[line 53]

  • Access: protected

Type:   mixed


[ Top ]

$groupByManager =

[line 61]

  • Access: protected

Type:   mixed


[ Top ]

$lastSQL =

[line 45]

  • Access: protected

Type:   mixed


[ Top ]

$mdb2 =

[line 39]

  • Access: protected

Type:   mixed


[ Top ]

$orderByManager =

[line 59]

  • Access: protected

Type:   mixed


[ Top ]

$otherFilters = array()

[line 55]

  • Access: protected

Type:   mixed


[ Top ]

$primary_key =

[line 43]

  • Access: protected

Type:   mixed


[ Top ]

$tableName =

[line 41]

  • Access: protected

Type:   mixed


[ Top ]

$validator =

[line 51]

  • Access: protected

Type:   mixed


[ Top ]



Method Detail

__construct (Constructor)   [line 74]

MDB2_TableBrowser_Single __construct( $mdb2, string $tableName, string $primary_key, [boolean $caseSensitive = false])

Constructor
  • Access: public

Parameters:

MDB2   $mdb2     MDB2 Object
string   $tableName     The table name
string   $primary_key     The primary key
boolean   $caseSensitive     Flag for case sensitivity

[ Top ]

deleteRow   [line 301]

int deleteRow( mixed $rowID)

Deletes a single row with the specified rowId.
  • Return: The number of affected rows (0 or 1)
  • Access: public

Parameters:

mixed   $rowID     The primary key value

[ Top ]

execute   [line 395]

int execute( string $sql)

Excecutes an sql statement
  • Return: the number of affected rows
  • Throws: MDB2_TableBrowser_DBException If the query failed
  • Access: protected

Parameters:

string   $sql     The sql statement

[ Top ]

getColumnValues   [line 174]

array getColumnValues( string $columnName, [integer $limit = MDB2_TableBrowser_InterfaceSingleTableBrowser::DEFAULT_MAX_ROWS], [integer $offset = 0])

Returns the different values a table column has. It also uses the currently defined filters to constrain the results returned.
  • Return: The column value
  • Access: public

Parameters:

string   $columnName     The column name
integer   $limit     Limit the number of results returned
integer   $offset     Offset

[ Top ]

getLastSQL   [line 409]

string getLastSQL( )

Returns the last sql statement
  • Access: public

[ Top ]

getRow   [line 247]

array getRow( mixed $rowID)

Returns a single row in the table with the primary key value specified.

This method ignores the currently defined filters.

  • Return: The row data
  • Access: public

Parameters:

mixed   $rowID     The primary_key value

[ Top ]

getRows   [line 233]

an getRows( [int $limit = MDB2_TableBrowser_InterfaceSingleTableBrowser::DEFAULT_MAX_ROWS], [int $offset = 0])

Reterives the rows in the table. It uses the currently defined filters to constrain the results returned.
  • Return: MDB2_Result object
  • Access: public

Parameters:

int   $limit     Limit results
int   $offset     Offset

[ Top ]

getRowsSQL   [line 199]

string getRowsSQL( )

Identical to calling getRows, but instead of excecuting the query it returns the sql that would have been generated from a getRows call.

This method is useful for debugging or building complex sql constructs that involve sub-selects.

  • Access: public

[ Top ]

insertRow   [line 318]

int insertRow( array $rowData)

Inserts a row
  • Return: The number of affected rows (0 or 1)
  • Access: public

Parameters:

array   $rowData     The new row data

[ Top ]

insertRows   [line 339]

int insertRows( array $columns, array $rowData)

Inserts multiple rows to the table
  • Return: The number of inserted rows
  • Access: public

Parameters:

array   $columns     The list of colums in the data
array   $rowData     The array containing the row data

[ Top ]

query   [line 376]

MDB2_Result query( string $sql)

Excecutes a select query
  • Return: object
  • Throws: MDB2_TableBrowser_DBException If the query failed
  • Access: protected

Parameters:

string   $sql     A select sql statement

[ Top ]

setDistinct   [line 150]

void setDistinct( )

Sets browser to return only unique results
  • Access: public

[ Top ]

unsetDistinct   [line 160]

void unsetDistinct( )

Sets the browser to return duplicate results
  • Access: public

[ Top ]

updateRow   [line 267]

int updateRow( mixed $rowID, array $rowData)

Updates a row
  • Return: The number of affected rows (0 or 1)
  • Throws: MDB2_TableBrowser_ParameterException
  • Access: public

Parameters:

mixed   $rowID     The primary key value
array   $rowData     The new row values

[ Top ]

__call   [line 134]

mixed __call( string $method, array $args)

Dispatch method to call methods defined in the supporting classes
  • Return: the dispatch method's return
  • Access: public

Parameters:

string   $method     The method name
array   $args     The method parameters

[ Top ]


Documentation generated on Fri, 13 Apr 2012 03:00:06 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.