Class Am_Table

Description

Class describes MySQL table

Located in /library/Am/Record.php (line 484)


	
			
Direct descendents
Class Description
Am_Protect_Table Table class to maintain a third-party script users table
Am_Protect_SessionTable Work with a third-party script PHP sessions MySQL table
Am_Table_WithData Class describes MySQL table
SavedPassTable Class describes MySQL table
ResourceAbstractTable Class describes MySQL table
InvoicePaymentTable
UserStatusTable Class describes MySQL table
AdminLogTable Class describes MySQL table
BanTable Class describes MySQL table
InvoiceItemTable Class describes MySQL table
CouponTable Class describes MySQL table
AccessLogTable Class describes MySQL table
InvoiceLogTable Class describes MySQL table
MailQueueTable Class describes MySQL table
TranslationTable Class describes MySQL table
CouponBatchTable Class describes MySQL table
ResourceAccessTable Class describes MySQL table
StateTable Class describes MySQL table
ProductUpgradeTable Class describes MySQL table
ProductCategoryTable Class describes MySQL table
CurrencyExchangeTable Class describes MySQL table
SavedFormTable
AccessTable Class describes MySQL table
EmailSentTable Class describes MySQL table
InvoiceRefundTable
AdminTable Class describes MySQL table
FileDownloadTable Class describes MySQL table
ErrorLogTable Class describes MySQL table
UserGroupTable Class describes MySQL table
CountryTable Class describes MySQL table
SavedReportTable Class describes MySQL table
Variable Summary
static mixed $infoCache
static mixed $instances
mixed $cache
mixed $useCache
DbSimple_Mysql $_db
mixed $_key
mixed $_keyIsInt
mixed $_table
Method Summary
Am_Table __construct ([ $db = null], [ $table = null], [ $key = null], [ $recordClass = null])
void count ()
int countBy ([array $conditions = array()])
Am_Record createRecord ([array $row = null])
void delete ( $key)
void deleteBy (array $conditions, [type $useObjects = true])
void exportReturnXml ([ $excludeFields = array()])
void filterId ( $id)
array findBy ([array $conditions = array()], [ $start = null], [ $count = null], [ $orderBy = null])
Am_Record findFirstBy ([array $conditions = array()], [ $orderBy = null])
DbSimple_Mysql getAdapter ()
array getFields ([ $onlyFieldNames = false])
void getKeyField ()
string getName ([ $withoutPrefix = false])
void getRecordClass ()
void importXml ( $xmlString)
void init ()
void insert (array $values, [ $returnInserted = false])
Am_Record|null load ( $key, [ $throwExceptions = true])
void loadIds (array $ids)
array loadRow ( $key, [ $throwExceptions = true])
void replace (array $values)
void resetCache ()
Am_Record[] selectObjects ( $sql, [ $param1 = null])
void setDi (Am_Di $di)
void toggleCache ( $flag)
void update ( $key, array $values)
void _dumpAll ([ $whereAdd = null])
void _getSqlWithArrayConditions ( $sql,  $conditions)
void _setAdapter ( $db)
void __call ( $name,  $arguments)
void __sleep ()
void __wakeup ()
Variables
static mixed $infoCache = array() (line 495)
  • access: protected
static mixed $instances = array() (line 496)
  • access: protected
mixed $cache = array() (line 499)
  • access: protected
mixed $useCache = false (line 498)
  • access: protected

Redefined in descendants as:
mixed $_checkUnique = null (line 501)
  • access: public

Redefined in descendants as:
DbSimple_Mysql $_db (line 488)
  • access: protected
mixed $_keyIsInt = true (line 493)

filter key value as integer (default), or as string

  • access: protected

Redefined in descendants as:
Methods
Constructor __construct (line 503)
Am_Table __construct ([ $db = null], [ $table = null], [ $key = null], [ $recordClass = null])
  • $db
  • $table
  • $key
  • $recordClass

Redefined in descendants as:
count (line 588)
void count ()
countBy (line 711)

Return number of records matching the conditions

  • return: number of records
int countBy ([array $conditions = array()])
  • array $conditions
createRecord (line 568)

Create an instance of record class

Am_Record createRecord ([array $row = null])
  • array $row
delete (line 792)
  • access: public
void delete ( $key)
  • $key

Redefined in descendants as:
deleteBy (line 696)

Delete records matching the condition

void deleteBy (array $conditions, [type $useObjects = true])
  • array $conditions
  • type $useObjects: to call $record->delete() method (default)
exportReturnXml (line 875)
  • access: public
void exportReturnXml ([ $excludeFields = array()])
  • $excludeFields
filterId (line 748)

Filter key value

void filterId ( $id)
  • $id
findBy (line 650)

Find objects based on criteria in array

conditions are joined with AND WARNING: order condition is not escaped!

  • return: of records
array findBy ([array $conditions = array()], [ $start = null], [ $count = null], [ $orderBy = null])
  • array $conditions
  • $start
  • $count
  • $orderBy
findFirstBy (line 684)

Find only first occurence

Am_Record findFirstBy ([array $conditions = array()], [ $orderBy = null])
  • array $conditions
  • $orderBy
getAdapter (line 536)
DbSimple_Mysql getAdapter ()
getDefaultRecord (line 896)

Return record with all fields defined as in MySQL table and default values set according to table def.

  • access: public
Am_Record getDefaultRecord ()
getDi (line 528)
Am_Di getDi ()
getFields (line 838)

Get table definition from database and return array like

<example> Array ( [cc_id] => stdClass Object ( [field] => cc_id [type] => int(11) [null] => NO [key] => PRI [default] => [extra] => auto_increment )

[user_id] => stdClass Object ( [field] => user_id [type] => int(11) [null] => NO [key] => UNI [default] => [extra] => ) </example>

  • return: array of field defs objects
array getFields ([ $onlyFieldNames = false])
  • $onlyFieldNames
getKeyField (line 554)
void getKeyField ()
getName (line 549)
  • return: tablename with ?_ instead of prefix
string getName ([ $withoutPrefix = false])
  • $withoutPrefix
getRecordClass (line 559)
void getRecordClass ()
importXml (line 884)
  • access: public
void importXml ( $xmlString)
  • $xmlString
init (line 520)
void init ()

Redefined in descendants as:
insert (line 773)
  • access: public
void insert (array $values, [ $returnInserted = false])
  • array $values
  • $returnInserted

Redefined in descendants as:
load (line 734)
  • access: public
Am_Record|null load ( $key, [ $throwExceptions = true])
  • $key
  • $throwExceptions
loadIds (line 672)

Load records by ids

void loadIds (array $ids)
  • array $ids: of Am_Record $idOrArray
loadRow (line 754)
  • return: loaded record
  • access: public
array loadRow ( $key, [ $throwExceptions = true])
  • $key
  • $throwExceptions
replace (line 787)
  • access: public
void replace (array $values)
  • array $values
resetCache (line 805)
  • access: public
void resetCache ()
selectObjects (line 598)

Run query with parameters @link DbSimple->select

and return record objects

Am_Record[] selectObjects ( $sql, [ $param1 = null])
  • $sql
  • $param1
setDi (line 522)
void setDi (Am_Di $di)
toggleCache (line 800)
void toggleCache ( $flag)
  • $flag
update (line 781)
  • access: public
void update ( $key, array $values)
  • $key
  • array $values
_dumpAll (line 576)

for debug usage only!

void _dumpAll ([ $whereAdd = null])
  • $whereAdd
_getSqlWithArrayConditions (line 617)
  • access: protected
void _getSqlWithArrayConditions ( $sql,  $conditions)
  • $sql
  • $conditions
_setAdapter (line 541)
void _setAdapter ( $db)
  • $db
__call (line 719)
  • access: public
void __call ( $name,  $arguments)
  • $name
  • $arguments
__sleep (line 861)
  • access: public
void __sleep ()
__wakeup (line 869)
  • access: public
void __wakeup ()

Documentation generated on Wed, 11 Apr 2012 09:05:22 -0400 by phpDocumentor 1.4.4