Class: I2CE CachedForm: Difference between revisions
No edit summary |
No edit summary |
||
Line 2: | Line 2: | ||
*Extends the class: [[Class: I2CE_Fuzzy | I2CE_Fuzzy]]. | *Extends the class: [[Class: I2CE_Fuzzy | I2CE_Fuzzy]]. | ||
*Location: Part of the module [[I2CE Module List#CachedForms|CachedForms]] in the package [https://launchpad.net/i2ce I2CE] | *Location: Part of the module [[I2CE Module List#CachedForms|CachedForms]] in the package [https://launchpad.net/i2ce I2CE] | ||
*Source: Defined in the file [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0. | *Source: Defined in the file [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php#L29 modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php] on line 29 | ||
*Author: Carl Leitner <litlfred@ibiblio.org> | *Author: Carl Leitner <litlfred@ibiblio.org> | ||
I2CE_CachedForm | I2CE_CachedForm | ||
Line 8: | Line 8: | ||
===$form=== | ===$form=== | ||
The form we are caching | The form we are caching | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php#L33 i2ce/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php] on line 33 | |||
*Type: protected [http://www.php.net/manual/en/language.types.string.php string ] $form | *Type: protected [http://www.php.net/manual/en/language.types.string.php string ] $form | ||
===$database=== | ===$database=== | ||
the database name (unquoted) | the database name (unquoted) | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php#L38 i2ce/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php] on line 38 | |||
*Type: protected [http://www.php.net/manual/en/language.types.string.php string ] $database | *Type: protected [http://www.php.net/manual/en/language.types.string.php string ] $database | ||
===$table_name=== | ===$table_name=== | ||
the table name for this form. | the table name for this form. | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php#L42 i2ce/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php] on line 42 | |||
*Type: protected [http://www.php.net/manual/en/language.types.string.php string ] $table_name | *Type: protected [http://www.php.net/manual/en/language.types.string.php string ] $table_name | ||
===$short_table_name=== | ===$short_table_name=== | ||
the table name for this form without quotes and without the databse | the table name for this form without quotes and without the databse | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php#L46 i2ce/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php] on line 46 | |||
*Type: protected [http://www.php.net/manual/en/language.types.string.php string ] $short_table_name | *Type: protected [http://www.php.net/manual/en/language.types.string.php string ] $short_table_name | ||
===$last_entry_database=== | ===$last_entry_database=== | ||
the database name (unquoted) where last_entry is | the database name (unquoted) where last_entry is | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php#L50 i2ce/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php] on line 50 | |||
*Type: protected [http://www.php.net/manual/en/language.types.string.php string ] $last_entry_database | *Type: protected [http://www.php.net/manual/en/language.types.string.php string ] $last_entry_database | ||
===$formObj=== | ===$formObj=== | ||
An instance of the form object | An instance of the form object | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php#L56 i2ce/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php] on line 56 | |||
*Type: protected [[Class: I2CE_Form | I2CE_Form]] $formObj | *Type: protected [[Class: I2CE_Form | I2CE_Form]] $formObj | ||
===$formMech=== | ===$formMech=== | ||
An instance of the form storage mechansim for the form | An instance of the form storage mechansim for the form | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php#L61 i2ce/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php] on line 61 | |||
*Type: protected [[Class: I2CE_FormStorage_Mechanism | I2CE_FormStorage_Mechanism]] $formMech | *Type: protected [[Class: I2CE_FormStorage_Mechanism | I2CE_FormStorage_Mechanism]] $formMech | ||
Line 37: | Line 44: | ||
===__construct()=== | ===__construct()=== | ||
The constructor | The constructor | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php#L68 i2ce/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php] on line 68 | |||
*Signature: public function __construct($form) | *Signature: public function __construct($form) | ||
*Parameters: | *Parameters: | ||
Line 42: | Line 50: | ||
===createCacheTable()=== | ===createCacheTable()=== | ||
setup of the queries used to create and populate the cached table | setup of the queries used to create and populate the cached table | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php#L456 i2ce/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php] on line 456 | |||
*Signature: protected function createCacheTable() | *Signature: protected function createCacheTable() | ||
*Returns: boolean.<br/>True on success, false on error | *Returns: boolean.<br/>True on success, false on error | ||
===createTable()=== | ===createTable()=== | ||
Create the cached table if does not exist and does not have the correct columns | Create the cached table if does not exist and does not have the correct columns | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php#L339 i2ce/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php] on line 339 | |||
*Signature: protected function createTable() | *Signature: protected function createTable() | ||
===dropTable()=== | ===dropTable()=== | ||
Drops the existing cached table from the database | Drops the existing cached table from the database | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php#L221 i2ce/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php] on line 221 | |||
*Signature: public function dropTable() | *Signature: public function dropTable() | ||
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ] | *Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ] | ||
===fastPopulate()=== | ===fastPopulate()=== | ||
Method used to populate the cache table in case the form storage mechanism is DB like | Method used to populate the cache table in case the form storage mechanism is DB like | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php#L348 i2ce/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php] on line 348 | |||
*Signature: protected function fastPopulate() | *Signature: protected function fastPopulate() | ||
===generateCachedTable()=== | ===generateCachedTable()=== | ||
Generates the cahced table for the form | Generates the cahced table for the form | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php#L310 i2ce/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php] on line 310 | |||
*Signature: public function generateCachedTable($check_stale) | *Signature: public function generateCachedTable($check_stale) | ||
*Parameters: | *Parameters: | ||
Line 62: | Line 75: | ||
===getCacheDatabase()=== | ===getCacheDatabase()=== | ||
Get the name of the database that the cached tables are stored in. | Get the name of the database that the cached tables are stored in. | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php#L116 i2ce/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php] on line 116 | |||
*Signature: static public function getCacheDatabase() | *Signature: static public function getCacheDatabase() | ||
*Returns: [http://www.php.net/manual/en/language.types.string.php string ]<br/>The string may be empty meaning that we are using the database for the DB connection | *Returns: [http://www.php.net/manual/en/language.types.string.php string ]<br/>The string may be empty meaning that we are using the database for the DB connection | ||
===getCachedTableName()=== | ===getCachedTableName()=== | ||
Get the name of the cached table for the specfiied form. | Get the name of the cached table for the specfiied form. | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php#L132 i2ce/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php] on line 132 | |||
*Signature: static public function getCachedTableName($form,$withDB,$table_prefix) | *Signature: static public function getCachedTableName($form,$withDB,$table_prefix) | ||
*Parameters: | *Parameters: | ||
Line 76: | Line 91: | ||
===getIDs()=== | ===getIDs()=== | ||
Get the id's of the cached forms. | Get the id's of the cached forms. | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php#L99 i2ce/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php] on line 99 | |||
*Signature: public function getIDs() | *Signature: public function getIDs() | ||
===isStale()=== | ===isStale()=== | ||
Checks to see if the cached table is stale | Checks to see if the cached table is stale | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php#L160 i2ce/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php] on line 160 | |||
*Signature: public function isStale() | *Signature: public function isStale() | ||
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ] | *Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ] | ||
===slowPopulate()=== | ===slowPopulate()=== | ||
Method used to populate the cache table in case the form storage mechanism is not DB like | Method used to populate the cache table in case the form storage mechanism is not DB like | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php#L392 i2ce/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php] on line 392 | |||
*Signature: protected function slowPopulate() | *Signature: protected function slowPopulate() | ||
===tableExists()=== | ===tableExists()=== | ||
Check to see if the cached table for this table exists and has the the proper fields for its columns. If it is invalud, it will drop the table. | Check to see if the cached table for this table exists and has the the proper fields for its columns. If it is invalud, it will drop the table. | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php#L240 i2ce/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php] on line 240 | |||
*Signature: public function tableExists() | *Signature: public function tableExists() | ||
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ] | *Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ] |
Revision as of 09:48, 10 November 2009
This article describes the class I2CE_CachedForm.
- Extends the class: I2CE_Fuzzy.
- Location: Part of the module CachedForms in the package I2CE
- Source: Defined in the file modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php on line 29
- Author: Carl Leitner <litlfred@ibiblio.org>
I2CE_CachedForm
Variables
$form
The form we are caching
- Defined in i2ce/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php on line 33
- Type: protected string $form
$database
the database name (unquoted)
- Defined in i2ce/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php on line 38
- Type: protected string $database
$table_name
the table name for this form.
- Defined in i2ce/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php on line 42
- Type: protected string $table_name
$short_table_name
the table name for this form without quotes and without the databse
- Defined in i2ce/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php on line 46
- Type: protected string $short_table_name
$last_entry_database
the database name (unquoted) where last_entry is
- Defined in i2ce/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php on line 50
- Type: protected string $last_entry_database
$formObj
An instance of the form object
- Defined in i2ce/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php on line 56
- Type: protected I2CE_Form $formObj
$formMech
An instance of the form storage mechansim for the form
- Defined in i2ce/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php on line 61
- Type: protected I2CE_FormStorage_Mechanism $formMech
Methods
__construct()
The constructor
- Defined in i2ce/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php on line 68
- Signature: public function __construct($form)
- Parameters:
- string $form
The form we wish to cash into a table
- string $form
createCacheTable()
setup of the queries used to create and populate the cached table
- Defined in i2ce/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php on line 456
- Signature: protected function createCacheTable()
- Returns: boolean.
True on success, false on error
createTable()
Create the cached table if does not exist and does not have the correct columns
- Defined in i2ce/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php on line 339
- Signature: protected function createTable()
dropTable()
Drops the existing cached table from the database
- Defined in i2ce/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php on line 221
- Signature: public function dropTable()
- Returns: boolean
fastPopulate()
Method used to populate the cache table in case the form storage mechanism is DB like
- Defined in i2ce/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php on line 348
- Signature: protected function fastPopulate()
generateCachedTable()
Generates the cahced table for the form
- Defined in i2ce/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php on line 310
- Signature: public function generateCachedTable($check_stale)
- Parameters:
- boolean $check_stale
Defaults to true. If false, it skips the staleness check- Default Value: true
- boolean $check_stale
getCacheDatabase()
Get the name of the database that the cached tables are stored in.
- Defined in i2ce/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php on line 116
- Signature: static public function getCacheDatabase()
- Returns: string
The string may be empty meaning that we are using the database for the DB connection
getCachedTableName()
Get the name of the cached table for the specfiied form.
- Defined in i2ce/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php on line 132
- Signature: static public function getCachedTableName($form,$withDB,$table_prefix)
- Parameters:
- Returns: string
getIDs()
Get the id's of the cached forms.
- Defined in i2ce/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php on line 99
- Signature: public function getIDs()
isStale()
Checks to see if the cached table is stale
- Defined in i2ce/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php on line 160
- Signature: public function isStale()
- Returns: boolean
slowPopulate()
Method used to populate the cache table in case the form storage mechanism is not DB like
- Defined in i2ce/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php on line 392
- Signature: protected function slowPopulate()
tableExists()
Check to see if the cached table for this table exists and has the the proper fields for its columns. If it is invalud, it will drop the table.
- Defined in i2ce/modules/Forms/modules/CachedForms/lib/I2CE_CachedForm.php on line 240
- Signature: public function tableExists()
- Returns: boolean
Inherited Methods
_hasMethod()
This public method is inherited from I2CE_Fuzzy->_hasMethod()
Inherited Fuzzy Methods
userMessage()
This method is inherited from I2CE_Fuzzy->userMessage()