Docs For Class atkStatement
Atk API home Class tree Element index

Todo list

Packages: » atk Classes: general » AllTests » atkConfig » atkController » atkDataNode » atkErrorHandlerBase » atkFileEditor » atkLanguage » atkMailErrorHandler » atkMetaNode » atkMockNode » atkNode » atkNodeValidator » atkOneToManyRelationSessionGridHandler » atkPHPView » atkSessionStore » atkStatementIterator » atkTreeNode » atkWizardBase » atkZendPlatformErrorHandler » clsTbsDataSource » clsTbsLocator » clsTinyButStrong » clsTinyButStrongOOo » FCKeditor » getSupportedLanguagesCollector » layout » node » sql_whereclause_blacklist_checker » test » tree utils » atkAbstractFrame » atkActionListener » atkClassFinder » atkClassLoader » atkCompatSelector » atkDataHolder » atkDebugger » atkDirectoryTraverser » atkEventLog » atkFileUtils » atkFrame » atkFrameSet » atkIpUtils » atkJSON » atkMail » atkMailer » atkMessageQueue » atkMLSelector » atkmlsplitter » atkRootFrameset » atkSelector » atkSelectorIterator » atkString » atkStringParser » atkTableRenderer » atkTableRendererGrouped » atkTextMarker » atkTmpFile » atkTriggerListener » atkYAML » atkZip » browserInfo fixture » atkAbstractFixtureLoader » atkFixtureManager » atkPHPFixtureLoader » atkYAMLFixtureLoader testcases » atkAbstractSearchHandler ui » atkActionBoxBuilder » atkDialog » atkIndexPage » atkOutput » atkPage » atkPageBuilder » atkTheme » atkThemeCompiler » atkUI handlers » atkActionHandler » atkAddHandler » atkAddOrCopyHandler » atkAdminHandler » atkAttributeEditHandler » atkCopyHandler » atkDeleteHandler » atkDocumentHandler » atkEditCopyHandler » atkEditHandler » atkExportHandler » atkFeedbackHandler » atkFileExport » atkImportHandler » atkMultiSelectHandler » atkMultiUpdatehandler » atkSaveHandler » atkSearchHandler » atkSelectHandler » atkSmartSearchHandler » atkUpdatehandler » atkViewEditBase » atkViewHandler » atkXmlHandler attributes » atkAggregatedColumn » atkAttribute » atkBoolAttribute » atkCalculatorAttribute » atkCaptchaAttribute » atkColorPickerAttribute » atkCountryAttribute » atkCreatedByAttribute » atkCreateStampAttribute » atkCurrencyAttribute » atkDateAttribute » atkDateTimeAttribute » atkDocumentAttribute » atkDummyAttribute » atkDurationAttribute » atkEmailAttribute » atkExpressionAttribute » atkFckAttribute » atkFieldSet » atkFileAttribute » atkFileWriterAttribute » atkFlagAttribute » atkFormatAttribute » atkFuzzySearchAttribute » atkHiddenAttribute » atkHtmlAttribute » atkIpAttribute » atkListAttribute » atkLiveTextPreview » atkMlAttribute » atkMlFckAttribute » atkMlHtmlAttribute » atkMlNumberAttribute » atkMlSelectorAttribute » atkMlTextAttribute » atkMlWrapper » atkMultipleFileAttribute » atkMultiSelectAttribute » atkNumberAttribute » atkParserAttribute » atkPasswordAttribute » atkProfileAttribute » atkRadioAttribute » atkRadioDetailsAttribute » atkRowCounter » atkStateAttribute » atkTabbedPane » atkTagAttribute » atkTextAttribute » atkTimeAttribute » atkTimeZoneAttribute » atkToolbar » atkUpdatedByAttribute » atkUpdateStampAttribute » atkUrlAttribute » atkWeekdayAttribute » atkWysiwygAttribute datatypes » atkArrayDt » atkDataType » atkStringDt » atkTime subpackage » atkAttributeTestCase security » atkBajusEncryption » atkBase64Encryption » atkEncryption » atkMockSecurityManager » atkOpenSSLEncryption » atkSecurityListener » atkSecurityManager » atkUrlVault » auth_config » auth_db » auth_imap » auth_interface » auth_ldap » auth_none » auth_pop3 » auth_saml » auth_server » auth_sspi cache » atkCache » atkCache_apc » atkCache_eaccelerator » atkCache_file » atkCache_memcache » atkCache_var » atkCache_xcache » atkCache_zp_disk » atkCache_zp_output » atkCache_zp_shm test » atkCacheTestCase » atkPluginTestCase » atkTestCase » test_sql_whereclause_blacklist_checker db » atkClusterDb » atkClusterDDL » atkClusterQuery » atkDb » atkdb2db » atkDb2DDL » atkDb2Query » atkDDL » atki5db » atki5DDL » atki5query » atkMockDb » atkMockDDL » atkMockQuery » atkMsSqlDb » atkMsSqlDDL » atkMssqlQuery » atkMysqlDb » atkMysqlDDL » atkMysqliDb » atkMysqliDDL » atkMysqliQuery » atkMysqlQuery » atkOci8Db » atkOci8DDL » atkOci8Query » atkOci9Db » atkOci9DDL » atkOci9Query » atkOci805Db » atkOci805Query » atkPgsqlDb » atkPgsqlDDL » atkPgsqlQuery » atkQuery recordlist » atkColumnConfig » atkCSVRecordList » atkCustomRecordList » atkExcelCSVRecordList » atkHTMLRecordList » atkPrintableRecordList » atkRecordList » atkRecordlistCache » atkTotalizer db-statement » atkCompatStatement » atkMySQLiStatement » atkStatement » atkStatementException » atkStatementParser console » atkConsoleController menu » atkcookmenu » atkDhtmlMenu » atkDropdownMenu » atkFramesMenu » atkMenu » atkmenuinterface » atkModernMenu » atkOutlookMenu » atkPlainMenu datagrid » atkDataGrid » atkDGComponent » atkDGEditControl » atkDGEvent » atkDGIndex » atkDGLimit » atkDGList » atkDGNoRecordsFound » atkDGPaginator » atkDGRenderer » atkDGSummary lock » atkDbLock » atkLock filters » atkDistinctFilter » atkFilter » atkGroupByFilter document » atkDocumentWriter » atkDocxWriter » atkOpenDocumentWriter meta » atkDutchMetaGrammar » atkMetaAttributeModifier » atkMetaCompiler » atkMetaGrammar » atkMetaPolicy » mod_meta relations » atkExtendableShuttleRelation » atkManyBoolRelation » atkManyToManyListRelation » atkManyToManyRelation » atkManyToManySelectRelation » atkManyToOneRelation » atkManyToOneTreeRelation » atkMatrixRelation » atkOneToManyRelation » atkOneToOneRelation » atkPolymorphicOneToOneRelation » atkRelation » atkSecureRelation » atkShuttleControl » atkShuttleFilter » atkShuttleRelation front » atkFrontController » atkFrontControllerBridge keyboard » atkKeyboard meta-relations » atkMetaExtendableShuttleRelation » atkMetaManyBoolRelation » atkMetaManyToManyListRelation » atkMetaManyToManySelectRelation » atkMetaManyToOneRelation » atkMetaOneToManyRelation » atkMetaOneToOneRelation » atkMetaShuttleRelation session » atkMockSessionManager » atkSessionManager » atkState modules » atkModule » mod_test listeners » atkRecycleBin interface » atkServer » atkSoapServer wizard » atkWizard » AtkWizardActionLoader » atkWizardPanel
Interfaces: datagrid » atkDGListener interface » atkServerInterface
Files: general » adodb-time.inc.php » AllTests.php » atknodetools.inc » atktools.inc » atktreetools.inc » basexml.php » bootstrap.inc » bootstrap.php » class.atkconfig.inc » class.atkcontroller.inc » class.atkdatanode.inc » class.atkerrorhandlerbase.inc » class.atkfileeditor.inc » class.atki5db.inc » class.atki5ddl.inc » class.atki5query.inc » class.atklanguage.inc » class.atkmailerrorhandler.inc » class.atkmetanode.inc » class.atkmocknode.inc » class.atkmocksessionmanager.inc » class.atknode.inc » class.atknodevalidator.inc » class.atkonetomanyrelationsessiongridhandler.inc » class.atkphpview.inc » class.atkpolymorphiconetoonerelation.inc » class.atksessionstore.inc » class.atkstatementiterator.inc » class.atktreenode.inc » class.atkwizardbase.inc » class.atkzendplatformerrorhandler.inc » class.layout.inc » class.nodename.inc » class.sql_whereclause_blacklist_checker.inc » class.test.inc » class.test_sql_whereclause_blacklist_checker.inc » commands.php » config.modules.inc » config.php » connector.php » console.php » db2yaml.php » defaultconfig.inc.php » fckeditor.php » fckeditor_php4.php » fckeditor_php5.php » io.php » module.inc » phpcompat.php » server.php » spellchecker.php » table2yaml.php » tbsooo_class.php » tbs_class.php » tooltip.tpl.php » upload.php » util.php » version.inc attributes » class.atkaggregatedcolumn.inc » class.atkattribute.inc » class.atkboolattribute.inc » class.atkcalculatorattribute.inc » class.atkcaptchaattribute.inc » class.atkcolorpickerattribute.inc » class.atkcountryattribute.inc » class.atkcreatedbyattribute.inc » class.atkcreatestampattribute.inc » class.atkcurrencyattribute.inc » class.atkdateattribute.inc » class.atkdatetimeattribute.inc » class.atkdocumentattribute.inc » class.atkdummyattribute.inc » class.atkdurationattribute.inc » class.atkemailattribute.inc » class.atkexpressionattribute.inc » class.atkfckattribute.inc » class.atkfieldset.inc » class.atkfileattribute.inc » class.atkfilewriterattribute.inc » class.atkflagattribute.inc » class.atkformatattribute.inc » class.atkfuzzysearchattribute.inc » class.atkhiddenattribute.inc » class.atkhtmlattribute.inc » class.atkipattribute.inc » class.atklistattribute.inc » class.atklivetextpreview.inc » class.atkmlattribute.inc » class.atkmlfckattribute.inc » class.atkmlhtmlattribute.inc » class.atkmlnumberattribute.inc » class.atkmlselectorattribute.inc » class.atkmltextattribute.inc » class.atkmlwrapper.inc » class.atkmultiplefileattribute.inc » class.atkmultiselectattribute.inc » class.atknumberattribute.inc » class.atkparserattribute.inc » class.atkpasswordattribute.inc » class.atkprofileattribute.inc » class.atkradioattribute.inc » class.atkradiodetailsattribute.inc » class.atkrowcounter.inc » class.atkstateattribute.inc » class.atktabbedpane.inc » class.atktagattribute.inc » class.atktextattribute.inc » class.atktimeattribute.inc » class.atktimezoneattribute.inc » class.atktoolbar.inc » class.atkupdatedbyattribute.inc » class.atkupdatestampattribute.inc » class.atkurlattribute.inc » class.atkweekdayattribute.inc » class.atkwysiwygattribute.inc attributes-- » property_accessor.php cache » class.atkcache.inc » class.atkcache_apc.inc » class.atkcache_eaccelerator.inc » class.atkcache_file.inc » class.atkcache_memcache.inc » class.atkcache_var.inc » class.atkcache_xcache.inc » class.atkcache_zp_disk.inc » class.atkcache_zp_output.inc » class.atkcache_zp_shm.inc console » class.atkconsolecontroller.inc datagrid » class.atkdatagrid.inc » class.atkdgcomponent.inc » class.atkdgeditcontrol.inc » class.atkdgevent.inc » class.atkdgindex.inc » class.atkdglimit.inc » class.atkdglist.inc » class.atkdglistener.inc » class.atkdgnorecordsfound.inc » class.atkdgpaginator.inc » class.atkdgrenderer.inc » class.atkdgsummary.inc datatypes » class.atkarraydt.inc » class.atkdatatype.inc » class.atkstringdt.inc » class.atktimedt.inc db » class.atkclusterdb.inc » class.atkclusterddl.inc » class.atkclusterquery.inc » class.atkdb.inc » class.atkdb2db.inc » class.atkdb2ddl.inc » class.atkdb2query.inc » class.atkddl.inc » class.atkmockdb.inc » class.atkmockddl.inc » class.atkmockquery.inc » class.atkmssqldb.inc » class.atkmssqlddl.inc » class.atkmssqlquery.inc » class.atkmysqldb.inc » class.atkmysqlddl.inc » class.atkmysqlidb.inc » class.atkmysqliddl.inc » class.atkmysqliquery.inc » class.atkmysqlquery.inc » class.atkoci8db.inc » class.atkoci8ddl.inc » class.atkoci8query.inc » class.atkoci9db.inc » class.atkoci9ddl.inc » class.atkoci9query.inc » class.atkoci805db.inc » class.atkoci805query.inc » class.atkpgsqldb.inc » class.atkpgsqlddl.inc » class.atkpgsqlquery.inc » class.atkquery.inc db-statement » class.atkcompatstatement.inc » class.atkmysqlistatement.inc » class.atkstatement.inc » class.atkstatementexception.inc » class.atkstatementparser.inc document » class.atkdocumentwriter.inc » class.atkdocxwriter.inc » class.atkopendocumentwriter.inc filters » class.atkdistinctfilter.inc » class.atkfilter.inc » class.atkgroupbyfilter.inc fixture » class.atkabstractfixtureloader.inc » class.atkfixturemanager.inc » class.atkphpfixtureloader.inc » class.atkyamlfixtureloader.inc front » class.atkfrontcontroller.inc » class.atkfrontcontrollerbridge.inc handlers » class.atkactionhandler.inc » class.atkaddhandler.inc » class.atkaddorcopyhandler.inc » class.atkadminhandler.inc » class.atkattributeedithandler.inc » class.atkcopyhandler.inc » class.atkdeletehandler.inc » class.atkdocumenthandler.inc » class.atkeditcopyhandler.inc » class.atkedithandler.inc » class.atkexporthandler.inc » class.atkfeedbackhandler.inc » class.atkfileexport.inc » class.atkimporthandler.inc » class.atkmultiselecthandler.inc » class.atkmultiupdatehandler.inc » class.atksavehandler.inc » class.atksearchhandler.inc » class.atkselecthandler.inc » class.atksmartsearchhandler.inc » class.atkupdatehandler.inc » class.atkvieweditbase.inc » class.atkviewhandler.inc » class.atkxmlhandler.inc include » autoload.inc » basics.inc » compatibility.inc » configs.inc » debugging.inc » errorhandler.inc » globals.inc » initial.inc » security.inc interface » class.atkserver.inc » class.atksoapserver.inc » interface.atkserverinterface.inc javascript » class.atkmultilanguage.js.php » class.atkprofileattribute.js.php » dhtml_tabs.js.php keyboard » class.atkkeyboard.inc listeners » class.atkrecyclebin.inc lock » class.atkdblock.inc » class.atklock.inc » lock.php lock-- » lock.js.php menu » atkmenutools.inc » class.atkcookmenu.inc » class.atkdhtmlmenu.inc » class.atkdropdownmenu.inc » class.atkframesmenu.inc » class.atkmenu.inc » class.atkmenuinterface.inc » class.atkmodernmenu.inc » class.atkoutlookmenu.inc » class.atkplainmenu.inc meta » class.atkdutchmetagrammar.inc » class.atkmetaattributemodifier.inc » class.atkmetacompiler.inc » class.atkmetagrammar.inc » class.atkmetapolicy.inc » module.inc meta-relations » class.atkmetaextendableshuttlerelation.inc » class.atkmetamanyboolrelation.inc » class.atkmetamanytomanylistrelation.inc » class.atkmetamanytomanyselectrelation.inc » class.atkmetamanytoonerelation.inc » class.atkmetaonetomanyrelation.inc » class.atkmetaonetoonerelation.inc » class.atkmetashuttlerelation.inc modules » class.atkmodule.inc modules-- » atkmoduletools.inc popups » colorpicker.inc recordlist » class.atkcolumnconfig.inc » class.atkcsvrecordlist.inc » class.atkcustomrecordlist.inc » class.atkexcelcsvrecordlist.inc » class.atkhtmlrecordlist.inc » class.atkprintablerecordlist.inc » class.atkrecordlist.inc » class.atkrecordlistcache.inc » class.atktotalizer.inc relations » class.atkextendableshuttlerelation.inc » class.atkmanyboolrelation.inc » class.atkmanytomanylistrelation.inc » class.atkmanytomanyrelation.inc » class.atkmanytomanyselectrelation.inc » class.atkmanytoonerelation.inc » class.atkmanytoonetreerelation.inc » class.atkmatrixrelation.inc » class.atkonetomanyrelation.inc » class.atkonetoonerelation.inc » class.atkrelation.inc » class.atksecurerelation.inc » class.atkshuttlecontrol.inc » class.atkshuttlefilter.inc » class.atkshuttlerelation.inc security » class.atkbajusencryption.inc » class.atkbase64encryption.inc » class.atkencryption.inc » class.atkmocksecuritymanager.inc » class.atkmocksecuritymanager.inc » class.atkopensslencryption.inc » class.atksecuritylistener.inc » class.atksecuritymanager.inc » class.atkurlvault.inc » class.auth_config.inc » class.auth_db.inc » class.auth_imap.inc » class.auth_interface.inc » class.auth_ldap.inc » class.auth_none.inc » class.auth_pop3.inc » class.auth_saml.inc » class.auth_server.inc » class.auth_sspi.inc session » class.atksessionmanager.inc » class.atkstate.inc skel » app.php » atk.inc » config.inc.php » debugger.php » dispatch.php » include.php » index.php » menu.php » top.php » welcome.php subpackage » class.atkattributetestcase.inc test » class.atkcachetestcase.inc » class.atkplugintestcase.inc » class.atktestcase.inc testcases » class.atkabstractsearchhandler.inc themes » themedef.inc » themedef.inc » themedef.inc » themedef.inc » themedef.inc » themedef.inc » themedef.inc » themedef.inc » themedef.inc » themedef.inc » themedef.inc » themedef.inc ui » block.atknavigator.php » block.atknavigatorinfo.php » class.atkactionboxbuilder.inc » class.atkdialog.inc » class.atkindexpage.inc » class.atkoutput.inc » class.atkpage.inc » class.atkpagebuilder.inc » class.atktheme.inc » class.atkthemecompiler.inc » class.atkui.inc » function.atkconf.php » function.atkconfig.php » function.atkdatefield.php » function.atkdispatchfile.php » function.atkfrontcontroller.php » function.atkloadscript.php » function.atkmessages.php » function.atkmoduledir.php » function.atkscript.php » function.atkstyle.php » function.atktext.php » function.atkthemeicon.php » function.atkthemeimg.php » function.stacktrace.php » modifier.atkjson.php » modifier.atkvardump.php » resource.string.php » resource.theme.php » resource.ui.php utils » atkbrowsertools.inc » class.atkactionlistener.inc » class.atkclassloader.inc » class.atkcompatselector.inc » class.atkdataholder.inc » class.atkdebugger.inc » class.atkdirectorytraverser.inc » class.atkeventlog.inc » class.atkfileutils.inc » class.atkframeset.inc » class.atkiputils.inc » class.atkjson.inc » class.atkmail.inc » class.atkmailer.inc » class.atkmessagequeue.inc » class.atkmlselector.inc » class.atkmlsplitter.inc » class.atkselector.inc » class.atkselectoriterator.inc » class.atkstring.inc » class.atkstringparser.inc » class.atktablerenderer.inc » class.atktablerenderergrouped.inc » class.atktextmarker.inc » class.atktmpfile.inc » class.atktriggerlistener.inc » class.atkyaml.inc » class.atkzip.inc » help.inc wizard » class.atkwizard.inc » class.atkwizardactionloader.inc » class.atkwizardpanel.inc
Home  ->  Documentation home  ->  Atk index  ->  Docs For Class atkStatement [ package: atk ]

Class: atkStatement

Source Location: /db/statement/class.atkstatement.inc

Class atkStatement

Class Overview

Implements interfaces:

  • IteratorAggregate (internal interface)

A statement can be used to execute a query.

The query can be re-used, e.g. executed multiple times, and may contain bind parameters. Both named and anonymous bind parameters are supported, but can't be mixed together. Named bind parameters are in the form of ":name", anonymous bind parameters are simply represented by a "?".

When fetching rows for a given query you can either use an iterator (efficient one-by-one retrieval of rows) or one of the convenience methods (e.g. getFirstRow, getAllRows, ...).

To create an instance please use the atkDb::prepare($query) method.

Example: $stmt = atkGetDb()->prepare("SELECT COUNT(*) FROM people WHERE birthday > :birthday"); $stmt->execute(array('birthday' => '1985-09-20')); foreach ($stmt as $person) { echo "{$person['firstname']} {$person['lastname'}\n"; } $stmt->close();

Located in /db/statement/class.atkstatement.inc [line 48]

Wiki documentation



		
				Author(s):
		
		
		API Tags:
Abstract:  

Information Tags:

Properties

Methods

[ Top ]

Descendants

Child Class Description
atkCompatStatement Base statement class used for database drivers which don't have their own implementation.
atkMySQLiStatement MySQLi statement implementation.

[ Top ]

Property Summary

array   $m_bindPositions   Positions of bind parameters.
array   $m_latestParams   Latest parameters supplied to the execute() method.
string   $m_parsedQuery   Parsed SQL query.
int   $m_position   Current row offset position.
string   $m_query   (Original) SQL query.

[ Top ]

Method Summary

atkStatement   __construct()   Constructs a new statement for the given query.
void   __destruct()   Destructor.
void   close()   Close this statement.
void   execute()   Executes the statement.
mixed   fetch()   Fetches the next row from the result set.
void   getAffectedRowCount()   Returns the number of affected rows in case of an INSERT, UPDATE or DELETE query.
array   getAllRows()   Get all rows for the given query.
array   getAllRowsAssoc()   Get rows in an associative array with the given column used as key for the rows.
array   getAllValues()   Get an array with all the values in the specified column.
array   getAllValuesAssoc()   Get rows in an associative array with the given key column used as key and the given value column used as value.
atkDb   getDb()   Returns the database instance.
array   getFirstRow()   Returns the first row.
mixed   getFirstValue()   Get the value of the first (or the given) column of the first row in the result.
atkStatementIterator   getIterator()   Returns an iterator for iterating over the result rows for this statement.
string   getQuery()   Returns the query on which this statement is based.
void   reset()   Resets this statement so that it can be re-used again.
void   rewind()   Moves the cursor back to the beginning of the result set.
void   _close()   Frees up all resources for this statement. The statement cannot be re-used anymore.
void   _execute()   Executes the statement using the given bind parameters.
array   _fetch()   Fetches the next row from the result set.
void   _getAffectedRowCount()   Returns the number of affected rows in case of an INSERT, UPDATE or DELETE query. Called immediatly after atkStatement::_execute().
array   _getBindPositions()   Returns the positions for the bind parameters in the query.
array   _getLatestParams()   Get latest execution parameters.
string   _getParsedQuery()   Returns the parsed query for this statement (e.g. named bind parameters are replaced by anonymous bind parameters).
void   _parse()   Parses the query. Named bind parameters are replaced by anonymous bind parameters and the positions of the different named/anonymous bind parameters are made available for later use.
void   _prepare()   Prepares the statement for execution.
void   _reset()   Resets the statement so that it can be re-used again.
void   _validateParams()   Validates if all bind parameters are supplied.

[ Top ]

Properties

array   $m_bindPositions [line 69]

Positions of bind parameters.

API Tags:
Access:  private


[ Top ]
array   $m_latestParams = array() [line 83]

Latest parameters supplied to the execute() method.

API Tags:
Access:  private


[ Top ]
string   $m_parsedQuery [line 62]

Parsed SQL query.

API Tags:
Access:  private


[ Top ]
int   $m_position = false [line 76]

Current row offset position.

API Tags:
Access:  private


[ Top ]
string   $m_query [line 55]

(Original) SQL query.

API Tags:
Access:  private


[ Top ]

Methods

Constructor __construct  [line 91]

  atkStatement __construct( atkDb $db, string $query  )

Constructs a new statement for the given query.

Parameters:
atkDb   $db:  database instance
string   $query:  SQL query

API Tags:
Access:  public


[ Top ]
Destructor __destruct  [line 102]

  void __destruct( )

Destructor.


API Tags:
Access:  public


[ Top ]
close  [line 225]

  void close( )

Close this statement.

Frees all resources after which this statement cannot be used anymore. If you want to re-use the statement, use the atkStatement::reset() method.


API Tags:
Access:  public


[ Top ]
execute  [line 275]

  void execute( [ $params = array()]  )

Executes the statement.

Parameters:
array   $params:  bind parameters

API Tags:
Access:  public


[ Top ]
fetch  [line 289]

  mixed fetch( )

Fetches the next row from the result set.


API Tags:
Return:  next row or false if there are no more rows
Access:  public


[ Top ]
getAffectedRowCount  [line 499]

  void getAffectedRowCount( )

Returns the number of affected rows in case of an INSERT, UPDATE or DELETE query.


API Tags:
Access:  public


[ Top ]
getAllRows  [line 360]

  array getAllRows( )

Get all rows for the given query.

NOTE: This is not an efficient way to retrieve records, as this will load all records into an array in memory. If you retrieve a lot of records, you are better of using atkStatement::getIterator which only retrieves one row at a time.

Depending on the database driver, using this method multiple times might result in the query to be executed multiple times.


API Tags:
Return:  rows
Access:  public


[ Top ]
getAllRowsAssoc  [line 381]

  array getAllRowsAssoc( [int|string $keyColumn = 0]  )

Get rows in an associative array with the given column used as key for the rows.

NOTE: This is not an efficient way to retrieve records, as this will load all records into an array in memory. If you retrieve a lot of records, you are better of using atkStatement::getIterator which only retrieves one row at a time.

Depending on the database driver, using this method multiple times might result in the query to be executed multiple times.

Parameters:
int|string   $keyColumn:  column index / name (default first column) to be used as key

API Tags:
Return:  rows
Access:  public


[ Top ]
getAllValues  [line 454]

  array getAllValues( [int|string $valueColumn = 0]  )

Get an array with all the values in the specified column.

NOTE: This is not an efficient way to retrieve records, as this will load all records into an array in memory. If you retrieve a lot of records, you are better of using atkStatement::getIterator which only retrieves one row at a time.

Depending on the database driver, using this method multiple times might result in the query to be executed multiple times.

Parameters:
int|string   $valueColumn:  column index / name (default first column) to be used as value

API Tags:
Return:  with values
Access:  public


[ Top ]
getAllValuesAssoc  [line 477]

  array getAllValuesAssoc( [int|string $keyColumn = 0], [int|string $valueColumn = 1]  )

Get rows in an associative array with the given key column used as key and the given value column used as value.

NOTE: This is not an efficient way to retrieve records, as this will load all records into an array in memory. If you retrieve a lot of records, you are better of using atkStatement::getIterator which only retrieves one row at a time.

Depending on the database driver, using this method multiple times might result in the query to be executed multiple times.

Parameters:
int|string   $keyColumn:  column index / name (default first column) to be used as key
int|string   $valueColumn:  column index / name (default first column) to be used as value

API Tags:
Return:  rows
Access:  public


[ Top ]
getDb  [line 124]

  atkDb getDb( )

Returns the database instance.


API Tags:
Return:  database instance
Access:  public


[ Top ]
getFirstRow  [line 332]

  array getFirstRow( )

Returns the first row.

NOTE: Depending on the database driver, using this method multiple times might result in the query to be executed multiple times.


API Tags:
Return:  row
Access:  public


[ Top ]
getFirstValue  [line 420]

  mixed getFirstValue( [int|string $valueColumn = 0], [mixed $fallback = null]  )

Get the value of the first (or the given) column of the first row in the result.

NOTE: Depending on the database driver, using this method multiple times might result in the query to be executed multiple times.

Parameters:
int|string   $valueColumn:  column index / name (default first column) to be used as value
mixed   $fallback:  fallback value if no result

API Tags:
Return:  first value
Access:  public


[ Top ]
getIterator  [line 315]

  atkStatementIterator getIterator( )

Returns an iterator for iterating over the result rows for this statement.

NOTE: Depending on the database driver, using this method multiple times might result in the query to be executed multiple times.


API Tags:
Return:  iterator
Access:  public


Implementation of:
IteratorAggregate::getIterator

[ Top ]
getQuery  [line 134]

  string getQuery( )

Returns the query on which this statement is based.


API Tags:
Return:  query
Access:  public


[ Top ]
reset  [line 212]

  void reset( )

Resets this statement so that it can be re-used again.


API Tags:
Access:  public


[ Top ]
rewind  [line 240]

  void rewind( )

Moves the cursor back to the beginning of the result set.

NOTE: Depending on the database driver, using this method might result in the query to be executed again.


API Tags:
Access:  public


Redefined in descendants as:

[ Top ]
_close  [line 201]

  void _close( )

Frees up all resources for this statement. The statement cannot be re-used anymore.


API Tags:
Abstract:  
Access:  protected


Redefined in descendants as:

[ Top ]
_execute  [line 183]

  void _execute( array $params  )

Executes the statement using the given bind parameters.

Parameters:
array   $params:  bind parameters

API Tags:
Abstract:  
Access:  protected


Redefined in descendants as:

[ Top ]
_fetch  [line 190]

  array _fetch( )

Fetches the next row from the result set.


API Tags:
Return:  next row from the result set (false if no other rows exist)
Abstract:  
Access:  protected


Redefined in descendants as:

[ Top ]
_getAffectedRowCount  [line 207]

  void _getAffectedRowCount( )

Returns the number of affected rows in case of an INSERT, UPDATE or DELETE query. Called immediatly after atkStatement::_execute().


API Tags:
Abstract:  
Access:  protected


Redefined in descendants as:

[ Top ]
_getBindPositions  [line 158]

  array _getBindPositions( )

Returns the positions for the bind parameters in the query.

The key of the array contains the character position, the value contains the bind parameter name or offset.


API Tags:
Return:  bind positions
Access:  protected


[ Top ]
_getLatestParams  [line 168]

  array _getLatestParams( )

Get latest execution parameters.


API Tags:
Return:  execution parameters
Access:  protected


[ Top ]
_getParsedQuery  [line 145]

  string _getParsedQuery( )

Returns the parsed query for this statement (e.g. named bind parameters are replaced by anonymous bind parameters).


API Tags:
Access:  protected


[ Top ]
_parse  [line 112]

  void _parse( )

Parses the query. Named bind parameters are replaced by anonymous bind parameters and the positions of the different named/anonymous bind parameters are made available for later use.


API Tags:
Access:  protected


[ Top ]
_prepare  [line 176]

  void _prepare( )

Prepares the statement for execution.


API Tags:
Abstract:  
Access:  protected


Redefined in descendants as:

[ Top ]
_reset  [line 195]

  void _reset( )

Resets the statement so that it can be re-used again.


API Tags:
Abstract:  
Access:  protected


Redefined in descendants as:

[ Top ]
_validateParams  [line 259]

  void _validateParams( array $params  )

Validates if all bind parameters are supplied.

Parameters:
array   $params:  bind parameters

API Tags:
Access:  protected


[ Top ]
Home | About | Contact