Class COciCommandBuilder
COciCommandBuilder provides basic methods to create query commands for
tables.
-
CComponent
-
CDbCommandBuilder
-
COciCommandBuilder
Methods summary
public
mixed
|
#
getLastInsertID( mixed $table )
Returns the last insertion ID for the specified table.
Returns the last insertion ID for the specified table.
Parameters
- $table
mixed $table the table schema (CDbTableSchema ) or the table name (string).
Returns
mixed last insertion id. Null is returned if no sequence name.
Overrides
|
public
string
|
#
applyLimit( string $sql, integer $limit, integer $offset )
Alters the SQL to apply LIMIT and OFFSET.
Alters the SQL to apply LIMIT and OFFSET.
Parameters
- $sql
string $sql SQL query string without LIMIT and OFFSET.
- $limit
integer $limit maximum number of rows, -1 to ignore limit.
- $offset
integer $offset row offset, -1 to ignore offset.
Returns
string SQL with LIMIT and OFFSET
Overrides
|
public
CDbCommand
|
#
createInsertCommand( mixed $table, array $data )
Creates an INSERT command.
Creates an INSERT command.
Parameters
- $table
mixed $table the table schema (CDbTableSchema ) or the table name (string).
- $data
array $data data to be inserted (column name=>column value). If a key is not a
valid column name, the corresponding value will be ignored.
Returns
Overrides
|
public
CDbCommand
|
#
createMultipleInsertCommand( mixed $table, array $data )
Creates a multiple INSERT command. This method could be used to achieve
better performance during insertion of the large amount of data into the
database tables.
Creates a multiple INSERT command. This method could be used to achieve
better performance during insertion of the large amount of data into the
database tables.
Parameters
- $table
mixed $table the table schema (CDbTableSchema ) or the table name (string).
- $data
array[] $data list data to be inserted, each value should be an array in format (column
name=>column value). If a key is not a valid column name, the corresponding
value will be ignored.
Returns
Since
1.1.14
Overrides
|
Methods inherited from CDbCommandBuilder
__construct(),
applyCondition(),
applyGroup(),
applyHaving(),
applyJoin(),
applyOrder(),
bindValues(),
composeMultipleInsertCommand(),
createColumnCriteria(),
createCompositeInCondition(),
createCountCommand(),
createCriteria(),
createDeleteCommand(),
createFindCommand(),
createInCondition(),
createPkCondition(),
createPkCriteria(),
createSearchCondition(),
createSqlCommand(),
createUpdateCommand(),
createUpdateCounterCommand(),
ensureTable(),
getDbConnection(),
getIntegerPrimaryKeyDefaultValue(),
getSchema()
|
Methods inherited from CComponent
__call(),
__get(),
__isset(),
__set(),
__unset(),
asa(),
attachBehavior(),
attachBehaviors(),
attachEventHandler(),
canGetProperty(),
canSetProperty(),
detachBehavior(),
detachBehaviors(),
detachEventHandler(),
disableBehavior(),
disableBehaviors(),
enableBehavior(),
enableBehaviors(),
evaluateExpression(),
getEventHandlers(),
hasEvent(),
hasEventHandler(),
hasProperty(),
raiseEvent()
|