Public Member Functions | Private Attributes
c_comdef_formats Class Reference

Include the format class. More...

List of all members.

Public Member Functions

 __construct ($in_parent_obj, $in_array)
 Constructor. Sets the parent object.
GetFormatsArray ()
 Accessor -Get the format object array.
 GetFormatBySharedIDCodeAndLanguage ($in_shared_id_bigint, $in_lang_enum=null)
 Return a reference to a single object, by shared ID and language.
 GetFormatsBySharedIDCode ($in_shared_id_bigint)
 Return all the formats that share a given shared ID code.
 GetFormatsByLanguage ($in_lang_enum=null)
 Return all the formats that share a given language.
 GetFormatsByString ($in_string, $in_lang_enum=null)
 Return all the formats that contain the given string.
 SetParentObj ($in_parent_obj)
 Set the parent object of this instance.
 GetParentObj ()
 Return a reference to the parent object of this instance.

Private Attributes

 $_local_id_parent_obj = null
 This is the parent (container) object that holds this instance.
 $_local_copy_of_array = null

Detailed Description

Include the format class.

A Class for Aggregating Format Codes

This class acts as an array aggregator for c_comdef_format objects. It is a class unto itself, because we want to have a couple of additional filtering options (like the ability to get a bunch of formats that share a _shared_id_bigint code).

The formats are kept in a simple two-dimensional array:

        $_local_copy_of_array = array[$lang_enum][$shared_id_bigint]

The combination of shared ID and language needs to be unique. This is how we match formats to languages. The same shared ID is used throughout the system, and we use the localization to return its key and description in the appropriate language.


Constructor & Destructor Documentation

c_comdef_formats::__construct ( in_parent_obj,
in_array 
)

Constructor. Sets the parent object.


Member Function Documentation

c_comdef_formats::GetFormatBySharedIDCodeAndLanguage ( in_shared_id_bigint,
in_lang_enum = null 
)

Return a reference to a single object, by shared ID and language.

You do not need to provide a language, in which case, the server's local language is used.

Returns:
A reference to the single selected object.

If no language is given, we use the server's native language.

Parameters:
in_shared_id_bigintThis is the shared ID code.
in_lang_enumThis is the code for the desired language. If not given, the server localization will be used.
& c_comdef_formats::GetFormatsArray ( )

Accessor -Get the format object array.

Returns:
a reference to an array of c_comdef_format objects.
c_comdef_formats::GetFormatsByLanguage ( in_lang_enum = null)

Return all the formats that share a given language.

You do not need to provide a language, in which case, the server's local language is used.

Returns:
A simple array of references to the objects for the formats in the given language. Null if no formats fit the language.

If no language is given, we use the server's native language.

Parameters:
in_lang_enumThis is the code for the desired language. If not given, the server localization will be used.
c_comdef_formats::GetFormatsBySharedIDCode ( in_shared_id_bigint)

Return all the formats that share a given shared ID code.

Returns:
A simple array of references to the objects for the formats in all languages for the given shared ID. Null if no formats fit the language.
Parameters:
in_shared_id_bigintThis is the shared ID code.
c_comdef_formats::GetFormatsByString ( in_string,
in_lang_enum = null 
)

Return all the formats that contain the given string.

If the language is English or Spanish, this does a metaphone search of all all the strings in the "en" or "es" formats. If it is any other language, then a simple string search is performed.

Returns:
A simple array of references to the objects for the formats in all languages for the given string. Null if no formats fit.

If no language is given, we use the server's native language.

We force the search to happen in lowercase. This is a very basic search.

If we will use metaphone, we convert our search criteria to metaphone keys.

We will look in each of the text fields for our string.

Parameters:
in_stringThis is the string to search for.
in_lang_enumThis is the code for the desired language. If not given, the server localization will be used.
c_comdef_formats::GetParentObj ( )

Return a reference to the parent object of this instance.

Returns:
a reference to the parent instance of the object.

Implements i_comdef_has_parent.

c_comdef_formats::SetParentObj ( in_parent_obj)

Set the parent object of this instance.

Parameters:
in_parent_objA reference to the parent object.

Implements i_comdef_has_parent.


Member Data Documentation

c_comdef_formats::$_local_copy_of_array = null [private]

We keep a local copy of the simple array, because we can instantly access it, as opposed to having to instantiate iterators.

c_comdef_formats::$_local_id_parent_obj = null [private]

This is the parent (container) object that holds this instance.


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Enumerations