Class: Insurance

Source Location: /class_insurance.php

Class Overview [line 16]

Core
   |
   --Insurance

Insurance methods.

Author(s):

  • Elpidio Latorilla

Version:

  • beta 1.0.08

Copyright:

  • 2002,2003,2004 Elpidio Latorilla

Variables

Methods


Child classes:

PersonInsurance
Personinsurance methods.

Inherited Methods

Class: Core

Core::coreFieldNames()
Returns the core field names of the core table in an array.
Core::deleteDBCache()
Deletes data from the database cache based on the id key.
Core::FilesListArray()
Returns a list of filename within a path in array.
Core::getAllDataArray()
Returns all records with the all items from the table.
Core::getAllDataObject()
Returns all records with all items from the table.
Core::getAllItemsArray()
Similar to getAllItemsObject() method but returns the records in an associative array.
Core::getAllItemsObject()
Returns all records with the needed items from the table.
Core::getDBCache()
Gets temporary data from the database cache.
Core::getErrorMsg()
Feturns the value of error_msg, the internal error message.
Core::getLastQuery()
Returns the the last sql query string
Core::getResult()
Feturns the value of result
Core::insertDataFromArray()
Inserts data from an array (passed by reference) into a table.
Core::insertDataFromInternalArray()
Inserts data from the internal array previously filled with data by the setDataArray() method.
Core::isPreLoaded()
Returns the value of is_preloaded that is set by methods that preload large number of data.
Core::LastRecordCount()
Returns the value of rec_count
Core::saveDBCache()
Saves temporary data to a cache in database.
Core::setDataArray()
Points the core data array to the external array that holds the data to be stored.
Core::setRefArray()
Points the reference variable $ref_array to the field names' array.
Core::setSQL()
Sets the internal sql query variable to the sql query.
Core::setTable()
Sets the coretable variable to the name of the database table.
Core::setWhereCondition()
Sets the "where" condition in an update query used with the updateDataFromInternalArray() method.
Core::Transact()
Transaction routine, ADODB transaction. It internally uses the ADODB transaction routine.
Core::updateDataFromArray()
Updates a record with the data from an array (passed by reference) based on the primary key.
Core::updateDataFromInternalArray()
Updates a table using data from an internal array previously filled with data by the setDataArray() method.
Core::_prepSaveArray()
Filters the data array intended for saving, removing the key-value pairs that do not correspond to the table's field names.
Core::_RecordExists()
Checks if a certain database record exists based onthe supplied query condition.


Class Details

Insurance methods.

Note this class should be instantiated only after a "$db" adodb connector object has been established by an adodb instance

Tags:

[ Top ]


Class Variables

$buffer =

[line 46]

Universal buffer

Type: mixed

Overrides: Array

[ Top ]

$firm_id =

[line 41]

Insurance company's id

Type: string

Overrides:

[ Top ]

$fld_insurance = array(
         'firm_id',
         'name',
         'iso_country_id',
         'sub_area',
         'type_nr',
         'addr',
         'addr_mail',
         'addr_billing',
         'addr_email',
         'phone_main',
         'phone_aux',
         'fax_main',
         'fax_aux',
         'contact_person',
         'contact_phone',
         'contact_fax',
         'contact_email',
         'use_frequency',
         'status',
         'history',
         'modify_id',
         'modify_time',
         'create_id',
         'create_time')

[line 61]

Field names of care_insurance_firm table

Type: array

Overrides:

[ Top ]

$ok =

[line 56]

Universal event flag

Type: boolean

Overrides: Array

[ Top ]

$result =

[line 31]

Buffer for sql query results

Tags:

  • var - adodb record object or boolean

Type: mixed

Overrides: Array

[ Top ]

$row =

[line 36]

Buffer for row returned by adodb's FetchRow() method

Type: array

Overrides:

[ Top ]

$sql =

[line 51]

Sql query string

Type: string

Overrides: Array

[ Top ]

$tb_class = 'care_class_insurance'

[line 21]

Table name insurance classes

Type: string

Overrides:

[ Top ]

$tb_insurance = 'care_insurance_firm'

[line 26]

Table name for insurance companies' data

Type: string

Overrides:

[ Top ]


Class Methods

Insurance

Insurance Insurance( [string $firm_id = ''])

[line 90]

Constructor

Parameters:

  • string $firm_id - Insurance company id

[ Top ]

countAllActiveFirms

integer countAllActiveFirms( )

[line 353]

Counts all active insurance firms.

Tags:

  • access - public

Parameters:

[ Top ]

FirmIDExists

void FirmIDExists( mixed $firm_id)

[line 182]

Alias of Firm_exists()

Parameters:

[ Top ]

Firm_exists

boolean Firm_exists( [string $firm_id = ''])

[line 170]

Checks if the insurance company exists in the database based on its firm id.

Tags:

  • access - public

Parameters:

  • string $firm_id - Firm id

[ Top ]

getAllActiveFirmsInfo

mixed getAllActiveFirmsInfo( [string $sortby = 'name'])

[line 316]

Gets all active insurance firms' information.

The returned adodb record object contains a row of array. Each array contains the company's data with index keys as outlined in the $fld_insurance array.

Tags:

  • return - adodb record object or boolean
  • access - public

Parameters:

  • string $sortby - Sort directive. Defaults to "name".

[ Top ]

getFirmInfo

mixed getFirmInfo( string $firm_id)

[line 252]

Gets the insurance company's complete information.

The returned adodb record object contains a row of array. Each array contains the company's data with index keys as outlined in the $fld_insurance array.

Tags:

  • return - adodb record object or boolean
  • access - public

Parameters:

  • string $firm_id - Firm id

[ Top ]

getFirmName

mixed getFirmName( string $firm_id)

[line 230]

Gets the insurance company's name.

Tags:

  • return - string or boolean
  • access - public

Parameters:

  • string $firm_id - Firm id

[ Top ]

getInsuranceClassInfoArray

mixed getInsuranceClassInfoArray( [string $items = 'class_nr,class_id,name,LD_var,description,status,history'])

[line 151]

Gets the information of all insurance classes. Returns 2 dimensional array.

Tags:

  • return - adodb record object or boolean
  • access - public

Parameters:

  • string $items - Field names of values to be fetched

[ Top ]

getInsuranceClassInfoObject

mixed getInsuranceClassInfoObject( [string $items = 'class_nr,class_id,name,LD_var,description,status,history'])

[line 134]

Gets the information of all insurance classes. Returns adodb record object.

Tags:

  • return - adodb record object or boolean
  • access - public

Parameters:

  • string $items - Field names of values to be fetched

[ Top ]

getLimitActiveFirmsInfo

mixed getLimitActiveFirmsInfo( [int $len = 30], [int $so = 0], [string $sortby = 'name'], [string $sortdir = 'ASC'])

[line 339]

Similar to getAllActiveFirmsInfo() but returns limited rows.

The returned adodb record object contains a row of array. Each array contains the company's data with index keys as outlined in the $fld_insurance array.

Tags:

  • return - adodb record object or boolean
  • access - public

Parameters:

  • int $len - Maximum number of rows returned
  • int $so - Index of first row to be returned
  • string $sortby - Sort field name. Defaults to "name".
  • string $sortdir - Sort direction. Defaults to "ASC" = ascending.

[ Top ]

getUseFrequency

mixed getUseFrequency( [string $firm_id = ''])

[line 192]

Gets the usage frequency of an insurance company based on its firm id key.

Tags:

  • return - integer or boolean
  • access - public

Parameters:

  • string $firm_id - Firm id

[ Top ]

saveFirmInfoFromArray

boolean saveFirmInfoFromArray( array &$data)

[line 272]

Inserts new insurance company's complete information in the database.

The data must be passed by reference with an associative array. The data must have the index keys as outlined in the $fld_insurance array.

Tags:

  • access - public

Parameters:

  • array &$data - Insurance company data

[ Top ]

searchActiveFirm

mixed searchActiveFirm( string $key)

[line 375]

Searches for all active firms based on the supplied search key.

The returned adodb record object contains rows of arrays. Each array contains the insurance firm data with the following index keys:

  • firm_id = firm id
  • name = insurance firm name
  • phone_main = main phone number
  • fax_main = main fax number
  • addr_email = main email address

Tags:

  • return - adodb record object or boolean
  • access - public

Parameters:

  • string $key - Search keyword

[ Top ]

searchCountActiveFirm

integer searchCountActiveFirm( string $key)

[line 449]

Searches similar to searchActiveFirm() but returns the resulting number of rows.

Unsuccessful search returns zero value (0).

Parameters:

  • string $key - Search keyword

[ Top ]

searchLimitActiveFirm

mixed searchLimitActiveFirm( string $key, [int $len = 30], [int $so = 0], [string $oitem = 'name'], [string $odir = 'ASC'])

[line 415]

Searches similar to searchActiveFirm() but returns limited number of rows.

For detailed structure of the returned data, see searchActiveFirm() method.

Tags:

  • return - adodb record object or boolean
  • access - public

Parameters:

  • string $key - Search keyword
  • int $len - Maximum number of rows returned, default = 30 rows
  • int $so - Start index offset, default 0 = start
  • string $oitem - Field name to sort, default = "name"
  • string $odir - Sorting direction, default = ASC

[ Top ]

setFirmID

void setFirmID( [string $firm_id = ''])

[line 100]

Sets the internal firm id buffer to the insurance company's id.

Tags:

  • access - public

Parameters:

  • string $firm_id - Insurance company id

[ Top ]

updateFirmInfoFromArray

boolean updateFirmInfoFromArray( int $nr, array &$data)

[line 293]

Updates an insurance company's information in the database.

The new data must be passed by reference with an associative array. The data must have the index keys as outlined in the $fld_insurance array.

Tags:

  • access - public

Parameters:

  • int $nr - Firm id
  • array &$data - Insurance company data

[ Top ]

updateUseFrequency

boolean updateUseFrequency( [string $firm_id = ''], [int $step = 1])

[line 212]

Increases usage frequency of an insurance company.

Tags:

  • access - public

Parameters:

  • string $firm_id - Firm id
  • int $step - Increase step

[ Top ]

_internResolveFirmID

boolean _internResolveFirmID( [string $firm_id = ''])

[line 109]

Resolves the insurance company's id.

Tags:

  • access - private

Parameters:

  • string $firm_id - Insurance company id

[ Top ]

_useInsurance

void _useInsurance( )

[line 123]

Sets the core to point to the insurance table's name and field names.

Tags:

  • access - public

Parameters:

[ Top ]


Documentation generated on Sun, 16 Nov 2003 01:02:47 +0100 by phpDocumentor 1.2.3