<?php
/**
* Project: CWF: Cricava Web Framework
* File: DataSource.class.php
*
* @link http://www.cricava.com/
* @copyright 2005-2009 Cricava Technologies, Inc.
* @author Mariano Iglesias <hide@address.com>
* @package com.cricava.cwf
* @version 1.0
*/
/**
* This class implements an abstract data source. NOTE: this class must be extended and its
* methods implemented.
*
* @abstract
* @author Mariano Iglesias
* @package com.cricava.cwf
* @subpackage i18n
* @since 1.0
*/
class DataSource
{
/**
* Function that handles the fetching of elements.
* <ul>
* <li>If no element specified, it will load all elements for a section.</li>
* <li>If no section specified, it will load all sections for the current container.</li>
* </ul>
*
* @param string The language to use
* @param string The locale to use (can be null)
* @param string The container to use
* @param string The section from where to get elements
* @param string The element to obtain
*
* @return array An indexed array by container, section, and elements
*
* @access public
* @since 1.0
*/
function & fetch($language, $locale, $container, $section = null, $element = null)
{
die("DataSource::fetch() - This method must be implemented!");
}
/**
* Obtain the list of languages and their locales.
*
* @param string The language to use when obtaining language & locale names
* @param boolean true if you want to obtain only active languages & locales, false otherwise
*
* @return array The list of languages
*
* @access public
* @since 1.0
*/
function & fetchLanguages($language, $onlyActive = true)
{
die("DataSource::fetchLanguages() - This method must be implemented!");
}
}
?>