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

Class: Translation2_Admin_Container_mdb2

Source Location: /Translation2-2.0.0beta11/Admin/Container/mdb2.php

Class Overview

Translation2_Container
   |
   --Translation2_Container_mdb2
      |
      --Translation2_Admin_Container_mdb2

Storage driver for storing/fetching data to/from a database


Author(s):

Version:

  • CVS: $Id: mdb2.php,v 1.22 2006/08/29 10:01:44 quipo Exp $

Copyright:

  • 2004-2005 Lorenzo Alberton

Methods


Inherited Variables

Inherited Methods

Class: Translation2_Container_mdb2

Translation2_Container_mdb2::fetchLangs()
Fetch the available langs if they're not cached yet.
Translation2_Container_mdb2::getOne()
Get a single item from the container
Translation2_Container_mdb2::getPage()
Returns an array of the strings in the selected page
Translation2_Container_mdb2::getStringID()
Get the stringID for the given string
Translation2_Container_mdb2::init()
Initialize the container

Class: Translation2_Container

Translation2_Container::Translation2_Container()
Constructor
Translation2_Container::fetchLangs()
Fetch the available langs if they're not cached yet.
Translation2_Container::getLang()
Gets the current lang
Translation2_Container::getLangData()
Gets the array data for the lang
Translation2_Container::getLangs()
Gets the available languages
Translation2_Container::getOne()
Get a single item from the container, without caching the whole page Containers should implement this method.
Translation2_Container::getPage()
Returns an array of the strings in the selected page Containers should implement this method.
Translation2_Container::getStringID()
Get the stringID for the given string
Translation2_Container::raiseError()
Trigger a PEAR error
Translation2_Container::setLang()
Sets the current lang
Translation2_Container::_parseOptions()
Parse options passed to the container class

Class Details

[line 57]
Storage driver for storing/fetching data to/from a database

This storage driver can use all databases which are supported by the PEAR::MDB2 abstraction layer to store and fetch data.



[ Top ]


Method Detail

add   [line 314]

true|PEAR_Error add( string $stringID, string $pageID, array $stringArray)

Add a new entry in the strings table.

Parameters:

string   $stringID     
string   $pageID     
array   $stringArray     Associative array with string translations. Sample format: array('en' => 'sample', 'it' => 'esempio')

[ Top ]

addLang   [line 83]

true|PEAR_Error addLang( array $langData)

Creates a new table to store the strings in this language.

If the table is shared with other langs, it is ALTERed to hold strings in this lang too.


Parameters:

array   $langData     

[ Top ]

addLangToList   [line 162]

true|PEAR_Error addLangToList( array $langData)

Creates a new entry in the langsAvail table.

If the table doesn't exist yet, it is created.


Parameters:

array   $langData     array('lang_id' => 'en', 'table_name' => 'i18n', 'name' => 'english', 'meta' => 'some meta info', 'error_text' => 'not available', 'encoding' => 'iso-8859-1');

[ Top ]

getPageNames   [line 479]

array getPageNames( )

Get a list of all the pageIDs in any table.

[ Top ]

remove   [line 438]

mixed remove( string $stringID, string $pageID)

Remove an entry from the strings table.
  • Return: true on success, PEAR_Error on failure

Parameters:

string   $stringID     
string   $pageID     

[ Top ]

removeLang   [line 233]

true|PEAR_Error removeLang( string $langID, boolean $force)

Remove the lang from the langsAvail table and drop the strings table.

If the strings table holds other langs and $force==false, then only the lang column is dropped. If $force==true the whole table is dropped without any check


Parameters:

string   $langID     
boolean   $force     

[ Top ]

update   [line 364]

true|PEAR_Error update( string $stringID, string $pageID, array $stringArray)

Update an existing entry in the strings table.

Parameters:

string   $stringID     
string   $pageID     
array   $stringArray     Associative array with string translations. Sample format: array('en' => 'sample', 'it' => 'esempio')

[ Top ]

updateLang   [line 272]

true|PEAR_Error updateLang( array $langData)

Update the lang info in the langsAvail table

Parameters:

array   $langData     

[ Top ]


Documentation generated on Sat, 14 Oct 2006 08:27:21 -0400 by phpDocumentor 1.3.0. PEAR Logo Copyright © PHP Group 2004.