soo_txp_obj API Documentation

soo_txp_upsert Class Reference

Class for INSERT and UPDATE queries. More...

List of all members.

Public Member Functions

 __construct ($init, $col=null)
 Constructor.
 set ($column, $value)
 Add a column:value pair to the $set array.
 upsert ()
 Run the query.

Public Attributes

 $columns = array()
 Columns to be explicitly set.
 $values = array()
 VALUES() values.
 $set = array()
 SET columns and values.

Protected Attributes

 $values_clause = ''
 VALUES() clause.
 $set_clause = ''
 SET clause.

Detailed Description

Class for INSERT and UPDATE queries.

Definition at line 570 of file soo_txp_obj.php.


Constructor & Destructor Documentation

soo_txp_upsert::__construct ( init,
col = null 
)

Constructor.

Use $col to update a single row matching on appropriate key column (usually `name` or `id`)

Parameters:
init Table name, soo_txp_rowset, or soo_txp_row
col Key column value for WHERE expression

Reimplemented from soo_txp_query.

Definition at line 592 of file soo_txp_obj.php.


Member Function Documentation

soo_txp_upsert::set ( column,
value 
)

Add a column:value pair to the $set array.

Parameters:
column Column name
value Column value

Definition at line 621 of file soo_txp_obj.php.

soo_txp_upsert::upsert (  ) 

Run the query.

Runs an UPDATE query if $where is set, otherwise INSERT

Returns:
bool success or failure

Definition at line 658 of file soo_txp_obj.php.


The documentation for this class was generated from the following file:
 All Classes Functions Variables