Welcome, Guest Log In

Class Krai_Db_Query

Class Overview

Database query object

This class is a wrapper around database query handles.

Located in /Krai/Db/Query.php [line 22]



		
		
		
		

Properties

Methods

[ Top ]
Property Summary
boolean   $_Closed   Is the query closed or not?
mixed   $_Query   The query object
array   $_Stats   Holds query stats

[ Top ]
Method Summary
Krai_Db_Query   __construct()   Constructor. Saves the passed query to the instance
integer   Affected()   Returns the number of affected rows
void   Close()   Close the query
mixed   Error()   Returns query error information
mixed   &GetQuery()   Get a reference to the query object
integer   InsertID()   Returns the last inserted id
boolean   IsClosed()   Is the query closed?
boolean   IsSuccessful()   Returns whether or not the query was successful
integer   NumRows()   Returns the number of rows in the resultset
mixed   __call()   PHP Magic Function
mixed   __get()   PHP Magic Function

[ Top ]
Properties
boolean   $_Closed = false [line 31]

Is the query closed or not?

This variable represents whether or not the query is closed.

API Tags:
Access:  protected


[ Top ]
mixed   $_Query = null [line 39]

The query object

This variable holds the actual query handle.

API Tags:
Access:  protected


[ Top ]
array   $_Stats = array(
"successful" => false,
"insertid" => null,
"affected" => null,
"numrows" => null,
"error" => array(null, null))
[line 49]

Holds query stats

This variable holds statistics for a query such as number of rows in the result, whether it was successful, the inserted ID, and the number of affected rows.

API Tags:
Access:  protected


[ Top ]
Methods
Constructor __construct  [line 62]

  Krai_Db_Query __construct( mixed $query, $stats  )

Constructor. Saves the passed query to the instance

Parameters:
mixed   $query: 
   $stats: 


[ Top ]
Affected  [line 196]

  integer Affected( )

Returns the number of affected rows

This function returns the value of the Krai_Db_Query::$_Stats "affected" key.


API Tags:
Access:  public


[ Top ]
Close  [line 86]

  void Close( )

Close the query

This function closes the query.


API Tags:
Access:  public


[ Top ]
Error  [line 227]

  mixed Error( [string $ret = "text"]  )

Returns query error information

This function returns the value of the Krai_Db_Query::$_Stats "error" key, formatted either as a string, as an error code, or an array of (string, error code).

Parameters:
string   $ret:  How to return the information ("text","number", or "array")

API Tags:
Access:  public

Information Tags:
Throws:  Krai_Db_Exception

[ Top ]
GetQuery  [line 154]

  mixed &GetQuery( )

Get a reference to the query object

This function returns a reference to the query object wrapped in the instance


API Tags:
Return:  The Query object
Access:  public


[ Top ]
InsertID  [line 210]

  integer InsertID( )

Returns the last inserted id

This function returns the value of the Krai_Db_Query::$_Stats "insertid" key.


API Tags:
Access:  public


[ Top ]
IsClosed  [line 75]

  boolean IsClosed( )

Is the query closed?

This function reports whether or not the query is closed.


API Tags:
Access:  public


[ Top ]
IsSuccessful  [line 168]

  boolean IsSuccessful( )

Returns whether or not the query was successful

This function returns the value of the Krai_Db_Query::$_Stats "successful" key.


API Tags:
Access:  public


[ Top ]
NumRows  [line 182]

  integer NumRows( )

Returns the number of rows in the resultset

This function returns the value of the Krai_Db_Query::$_Stats "numrows" key.


API Tags:
Access:  public


[ Top ]
__call  [line 106]

  mixed __call( mixed $m, mixed $p  )

PHP Magic Function

This function passes method calls on an instance of this class onto the query handle wrapped in the instance.

Parameters:
mixed   $m: 
mixed   $p: 

API Tags:
Access:  public


[ Top ]
__get  [line 135]

  mixed __get( mixed $v  )

PHP Magic Function

This function passes property requests on an instance of this class onto the query handle wrapped in the instance.

Parameters:
mixed   $v: 

API Tags:
Access:  public


[ Top ]

Documentation generated on Fri, 25 Jul 2008 15:19:47 -0400 by phpDocumentor 1.4.2
Krai Framework site admin credits sitemap valid xhtml?