Translation2
[ class tree: Translation2 ] [ index: Translation2 ] [ all elements ]

Class: Translation2_Container

Source Location: /Translation2-2.0.0beta8/Container.php

Class Overview


Base class for Translation2 drivers/containers


Author(s):

Copyright:

  • 2004-2005 Lorenzo Alberton

Variables

Methods


Child classes:

Translation2_Container_dataobjectsimple
Simple storage driver for fetching data from a db with DB_DataObject
Translation2_Container_db
Storage driver for fetching data from a database
Translation2_Container_gettext
Storage driver for fetching data with gettext
Translation2_Container_mdb
Storage driver for fetching data from a database
Translation2_Container_mdb2
Storage driver for fetching data from a database
Translation2_Container_xml
Storage driver for fetching data from a XML file

Inherited Variables

Inherited Methods


Class Details

[line 52]
Base class for Translation2 drivers/containers

Extend this class to provide custom containers. Some containers are already bundled with the package.



[ Top ]


Class Variables

$options = array()

[line 60]

Additional options for the storage container

Type:   array


[ Top ]



Method Detail

Translation2_Container (Constructor)   [line 82]

Translation2_Container Translation2_Container( )

Constructor

Has to be overwritten by each storage class

  • Access: public

[ Top ]

fetchLangs   [line 224]

void fetchLangs( )

Fetch the available langs if they're not cached yet.

Containers should implement this method.


Overridden in child classes as:

Translation2_Container_dataobjectsimple::fetchLangs()
Fetch the available langs if they're not cached yet.
Translation2_Container_db::fetchLangs()
Fetch the available langs if they're not cached yet.
Translation2_Container_gettext::fetchLangs()
Fetch the available langs if they're not cached yet.
Translation2_Container_mdb::fetchLangs()
Fetch the available langs if they're not cached yet.
Translation2_Container_mdb2::fetchLangs()
Fetch the available langs if they're not cached yet.
Translation2_Container_xml::fetchLangs()
Fetch the available langs

[ Top ]

getLang   [line 157]

mixed getLang( [string $format = 'id'])

Gets the current lang
  • Return: array with current lang data or null if not set yet

Parameters:

string   $format     

[ Top ]

getLangData   [line 171]

mixed getLangData( string $langID, [string $format = 'id'])

Gets the array data for the lang
  • Return: array with lang data or null if not available

Parameters:

string   $langID     
string   $format     

[ Top ]

getLangs   [line 184]

void getLangs( [string $format = 'array'])

Gets the available languages

Parameters:

string   $format     ['array' | 'ids' | 'names' | 'encodings']

[ Top ]

getOne   [line 252]

void getOne( mixed $stringID, [mixed $pageID = null], [mixed $langID = null])

Get a single item from the container, without caching the whole page Containers should implement this method.

Overridden in child classes as:

Translation2_Container_dataobjectsimple::getOne()
Get a single item from the container, without caching the whole page
Translation2_Container_db::getOne()
Get a single item from the container
Translation2_Container_gettext::getOne()
Get a single item from the container, without caching the whole page
Translation2_Container_mdb::getOne()
Get a single item from the container
Translation2_Container_mdb2::getOne()
Get a single item from the container
Translation2_Container_xml::getOne()
Get a single item from the container

[ Top ]

getPage   [line 239]

array getPage( string $pageID, mixed $langID)

Returns an array of the strings in the selected page Containers should implement this method.

Overridden in child classes as:

Translation2_Container_dataobjectsimple::getPage()
Returns an array of the strings in the selected page
Translation2_Container_db::getPage()
Returns an array of the strings in the selected page
Translation2_Container_gettext::getPage()
Get all the strings from a domain (parsing the .mo file)
Translation2_Container_mdb::getPage()
Returns an array of the strings in the selected page
Translation2_Container_mdb2::getPage()
Returns an array of the strings in the selected page
Translation2_Container_xml::getPage()
Returns an array of the strings in the selected page

Parameters:

string   $pageID     

[ Top ]

getStringID   [line 267]

string getStringID( mixed $string, string $pageID, string $stringID)

Get the stringID for the given string

Overridden in child classes as:

Translation2_Container_dataobjectsimple::getStringID()
Get the stringID for the given string
Translation2_Container_db::getStringID()
Get the stringID for the given string
Translation2_Container_gettext::getStringID()
Get the stringID for the given string
Translation2_Container_mdb::getStringID()
Get the stringID for the given string
Translation2_Container_mdb2::getStringID()
Get the stringID for the given string
Translation2_Container_xml::getStringID()
Get the stringID for the given string

Parameters:

string   $stringID     
string   $pageID     

[ Top ]

raiseError   [line 283]

void raiseError( string $msg, int $code, [mixed $mode = PEAR_ERROR_TRIGGER], [mixed $option = E_USER_WARNING])

Trigger a PEAR error
  • Access: public

Parameters:

string   $msg     error message
int   $code     error code

[ Top ]

setLang   [line 136]

void setLang( string $langID)

Sets the current lang

Overridden in child classes as:

Translation2_Container_gettext::setLang()
Sets the current lang

Parameters:

string   $langID     

[ Top ]

_parseOptions   [line 95]

void _parseOptions( array $array)

Parse options passed to the container class
  • Access: protected

Parameters:

array   $array     

[ Top ]


Documentation generated on Sun, 09 Oct 2005 06:32:12 -0400 by phpDocumentor 1.2.3. PEAR Logo Copyright © PHP Group 2004.