Home About phpAddDict Screenshots Demo Buy/Order FAQ Documentation Support Service
п»ї

phpAddDict API

Classes

Class

phpadddict_Container - Controls business logic

Public Methods

Description

factory($name,$conf)

Returns instance of container

@param string $name Class name
@param array $conf Configuration hash
@return object phpadddict_Container

Example:
$rc = phpadddict_Container::factory($contName,$contConf);

@throws object phpadddict_Error
@access public

getReferences($refNames=array(),$lang='en')

Returns indicated dictionaries


@param array $refNames Dictionary IDs to return
@param string $lang Language ID. Default is empty

@return array The hash of references.
Key : string - Reference ID
Value : array - Hash of reference contents. Hash of reference values.
    Key : string - Reference value ID.
    Value : string - Reference value name.

Example:

$refs = $rc->getReferences(array('job_function'),'en');


Returns:

array(1) {
["job_function"]=>
  array(3) {
    ["design"]=> string(17) "Making web design"
     ["prog"]=> string(11) "Programming"
    ["srs"]=> string(31) "Preparing Software Requirements" 
  }
}

@throws object phpadddict_Error
@access public

getLanguages()

Returns available languages


@return array The list of languages.

Example:

$langs = $rc->getLanguages();


Returns:

array(2) {
 [0]=>
 string(2) "en"
 [1]=>
 string(2) "ru"
}

@throws object phpadddict_Error
@access public

registerReference($refName,$refID)

Registers a new dictionary


@param string $refName Dictionary name
@param string $refID Dictionary ID


@return void


Example:

$err = $rc->registerReference('Business type','biz_type');


@throws object phpadddict_Error
@access public

registerValue($valName,$valID='',$lang='en',$refID)

Registers a new dictionary's value


@param string $valName New value's name
@param string $valID New value's ID. Default is empty. If empty, generates automatically
@param string $lang New value's language ID. Default is 'en'.
@param string $refID Dictionary's ID the value belongs to.

@return void


Example:

$err = $rc->registerValue('Manufacturer','mnf','','biz_type');


@throws object phpadddict_Error
@access public

registerLanguage($langID)

Registers a new language


@param string $langID New language ID

@return void


Example:

$err = $rc->registerLanguage('de');

@throws object phpadddict_Error
@access public

isValueExist($valID,$langID='en')

Checks if dictionary's value already registered


@param string $valID Value ID to check

@return boolean


Example:

$exists = $rc->isValueExist('mnf');


@throws object phpadddict_Error
@access public

isReferenceExist($refID)

Checks if dictionary already registered


@param string $refID Dictionary ID to check
@return boolean


Example:

$exists = $rc->isReferenceExist('biz_type');


@throws object phpadddict_Error
@access public

isLanguageExist($langID)

Checks if language already registered


@param string $langID Language ID to check

@return boolean


Example:

$exists = $rc->isLanguageExist('de');


@throws object phpadddict_Error
@access public

getReferenceList()

Returns list of dictionaries


@return array The hash of dictionaries.
Key : string - Dictionary ID
Value : string - Dictionary name

Example:

$refs = $rc->getReferenceList();


Returns:

  array(2) {
    ["gender"]=> "Gender"
    ["job_function"]=> "Job Function"

    ["biz_type"]=> "Business Type"

  }

@throws object phpadddict_Error
@access public

deleteReference($refID)

Deletes indicated dictionary with its values


@param string $refID Dictionary ID to delete

@return void


Example:

$err = $rc->deleteReference('biz_type');


@throws object phpadddict_Error
@access public

getReferenceName($refID)

Returns indicated dictionary name


@param string $refID Dictionary ID

@return string Dictionary name


Example:

$refName = $rc->getReferenceName('biz_type');


Returns:

string(13) "Business type"


@throws object phpadddict_Error
@access public

updateReference($oldRefID,$newRefID,$newName)

Updates dictionary's name and id. Correctly moves all related dictionary's values.


@param string $oldRefID Old Dictionary ID
@param string $newRefID New Dictionary ID
@param string $newName New Dictionary's Name


Example:

$err = $rc->updateReference('biz_type','biz_field','Business Field');


@return void
@throws object phpadddict_Error
@access public

deleteReferenceValue($valID,$langID = 'en')

Delete indicated dictionary value


@param string $valID Value ID to delete
@param string $langID Value language. Default is 'en'


@return void


Example:

$err = $rc->deleteReferenceValue('mnf');


@throws object phpadddict_Error
@access public

getValueName($valID,$langID='en')

Returns indicated value name


@param string $valID Value ID
@param string $langID Value's language

@return string Value name


Example:

$vName = $rc->getValueName('mnf','en');


Returns:

string(13) "Manufacturer"


@throws object phpadddict_Error
@access public

updateReferenceValue($oldValID,$newValID,$newName,$langID='en')

Updates indicated dictionary's value


@param string $oldValID Old Value ID
@param string $newValID New Value ID
@param string $newName New Value's Name
@param string $langID Value's Language


@return void


Example:

$err = $rc->updateReferenceValue('mnf','agn','Agent');


@throws object phpadddict_Error
@access public

deleteLanguage($langID)

Delete indicated language


@param string $langID Language ID to delete

@return void


Example:

$err = $rc->deleteLanguage('de');


@throws object phpadddict_Error
@access public

updateLanguage($oldLangID,$newLangID)

Updates language id


@param string $oldLangID Old Language ID
@param string $newLangID New Language ID

@return void


Example:

$err = $rc->updateLanguage('de','fr');

@throws object phpadddict_Error
@access public


Class

phpadddict_Error - Handles package errors

Extends PEAR::Error

Public Methods

Description

getMessage()

Returns error message

@return string Error message

Example:
$errMsg = $err->getMessage();

@access public

Home About phpAddDict Screenshots Demo Buy/Order FAQ Documentation Support Service Contact Us Press Center