Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages | Examples

tx_commerce_belib Class Reference

List of all members.

Public Member Functions

 getCategoriesForProductFromDB ($pUid)
 getAttributesForProduct ($pUid, $separateCT1=false, $addAttributeData=false, $getValueListData=false)
 getParentCategories ($cUid, &$cUidList, $dontAdd=0, $excludeUid=0, $recursive=true)
 getChildCategories ($cUid, &$cUidList, $dontAdd=0, $excludeUid=0, $recursive=true)
 getParentCategoriesFromList (&$cUidList)
 getCategoryData ($cUid, $select= '*', $groupBy= '', $orderBy= '')
 getAttributesForCategoryList ($catList, $ct=NULL, $uidField= 'uid', $excludeAttributes=array())
 getAttributesForCategory ($cUid, $ct=NULL, $excludeAttributes=NULL, $uidField= 'uid')
 getAttributeTitle ($aUid)
 getAttributeTitles ($attributeList, $uidField= 'uid')
 getAttributeData ($aUid, $select= '*')
 getAttributeValue ($pUid, $aUid, $relationTable, $relationData=NULL, $attributeData=NULL)
 getCtForAttributeOfProduct ($aUid, $pUid)
 getArticlesOfProduct ($pUid, $additionalWhere= '', $orderBy= '')
 getProductOfArticle ($aUid, $getProductData= '*')
 getAttributesForArticle ($aUid, $ct=NULL, $excludeAttributes=NULL)
 getArticleHash ($aUid, $fullAttributeList)
 updateArticleHash ($aUid, $fullAttributeList=NULL)
 isNumber ($data)
 getUidFromKey ($key, &$keyData)
 checkArray ($needle, $array, $field)
 enableFields ($table, $getDeleted=false)
 getUidListFromList ($list)
 saveRelations ($uid_local, $relationData, $relationTable, $delete=false, $withReference=true)
 getAllCorrelationTypes ()
 updateArticleXML ($articleRelations, $add=false, $articleUid=NULL, $productUid=NULL)
 updateXML ($xmlField, $table, $uid, $type, $ctList)
 mergeAttributeListFromFFData ($ffData, $prefix, $ctList, $uid_local, &$paList)
 extractFieldArray ($array, $field, $makeArray=false, $extraFields=array())
 getProductsOfCategory ($cUid)
 getUpdateData ($attributeData, $data, $productUid= '')
 buildLocalisedAttributeValues ($flexValue, $langIdent)
 savePriceFlexformWithArticle ($priceUid, $articleUid, $priceDataArray)
 getOrderFolderSelector ($pid, $levels, $aktLevel=0)
 updatePriceXMLFromDatabase ($articleUid)
 fix_articles_price ($article_uid=0)
 fix_product_atributte ($product_uid=0)
 fix_category_atributte ($category_uid=0)

Member Function Documentation

tx_commerce_belib::buildLocalisedAttributeValues flexValue,
langIdent
 

Builds the lokalised Array for the attribute Felxform

Author:
Ingo Schmitt <is@marketing-factory.de>
Parameters:
$flexValue String XML-Flex-Form
$langIdent Language Ident
Returns:
string String XML-Flex-Form
Decide on what to to on lokalisation, how to act
See also:
ext_conf_template attributeLokalisationType[0|1|2] 0: set blank 1: Copy 2: prepend [Translate to .$langRec['title'].:]
Walk thru the array and prepend text

tx_commerce_belib::checkArray needle,
array,
field
 

Searches for a string in an array of arrays.

Parameters:
string $needle: The string you want to check for
array $array: The array you want to search in
string $field: The fieldname of the inside arrays in the search array
Returns:
True if the needle was found, otherwise false

tx_commerce_belib::enableFields table,
getDeleted = false
 

Returns the "enable fields" for a sql query.

Parameters:
string $table: The table for the query
boolean $getDeleted: Flag if deleted entries schould be returned
Returns:
A SQL-string with the enable fields

tx_commerce_belib::extractFieldArray array,
field,
makeArray = false,
extraFields = array()
 

Extracts a fieldvalue from an associative array.

Parameters:
array $array: The data array
string $field: The field that should be extracted
boolean $makeArray: If true the result is returned as an array of arrays
array $extraFields: Add some extra fields to the result
Returns:
An array with fieldnames

tx_commerce_belib::fix_articles_price article_uid = 0  ) 
 

This makes the Xml to draw the price form of an article Call this function if you have imported data to the database and havn't updated the Flexform

Author:
Ricardo Mieres <ricardo.mieres@502.cl>
Parameters:
integer $article_uid
See also:
updatePriceXMLFromDatabase

tx_commerce_belib::fix_category_atributte category_uid = 0  ) 
 

This makes the Xml for the categoryt Attributes Call thos function if you have imported data to the database and havn't updated the Flexform

Author:
Ricardo Mieres <ricardo.mieres@502.cl>
Parameters:
integer $category_uid

tx_commerce_belib::fix_product_atributte product_uid = 0  ) 
 

This makes the Xml for the product Attributes Call thos function if you have imported data to the database and havn't updated the Flexform

Author:
Ricardo Mieres <ricardo.mieres@502.cl>
Parameters:
integer $product_uid

tx_commerce_belib::getAllCorrelationTypes  ) 
 

Get all existing correlation types.

Returns:
array with correlation type entities

tx_commerce_belib::getArticleHash aUid,
fullAttributeList
 

Returns the hash value for the ct1 select attributes for an article.

Parameters:
integer $aUid: the uid of the article
array $fullAttributeList: The list of uids for the attributes that are assigned to the article

tx_commerce_belib::getArticlesOfProduct pUid,
additionalWhere = '',
orderBy = ''
 

Return all articles that where created from a given product.

Parameters:
integer $pUid: The UID of the product
Returns:
An array of article datasets as assoc array or false if nothing was found
Since:
20.12.2005 Check if article exists

tx_commerce_belib::getAttributeData aUid,
select = '*'
 

Returns the complete dataset of an attribute. You can select which fields should be fetched from the database.

Parameters:
integer $aUid: The UID of the attribute
string $select: Select here, which fields should be fetched (default is *)
Returns:
An associative array with the attributeData

tx_commerce_belib::getAttributesForArticle aUid,
ct = NULL,
excludeAttributes = NULL
 

Returns all attributes for an article

Parameters:
integer $aUid: The article UID
integer $ct: The correlationtype
array $excludeAttributes: An array of relation datasets where the field "uid_foreign" is the UID of the attribute you don't want to get
Returns:
Return an array of attributes

tx_commerce_belib::getAttributesForCategory cUid,
ct = NULL,
excludeAttributes = NULL,
uidField = 'uid'
 

This fetches all attributes that are assigned to a category.

Parameters:
integer $cUid: the uid of the category
integer $ct: the correlationtype (can be null)
array $excludeAttributes: Array with attributes (the method expects a field called uid_foreign)
string $uidField: The name of the field in the excludeAttributes array that holds the uid of the attributes
Returns:
An array of attributes

tx_commerce_belib::getAttributesForCategoryList catList,
ct = NULL,
uidField = 'uid',
excludeAttributes = array()
 

Returns all attributes for a list of categories.

Parameters:
array $catList: A list of category UIDs
integer $ct: the correlationtype (can be null)
string $uidField: The name of the field in the excludeAttributes array that holds the uid of the attributes
array $excludeAttributes: Array with attributes (the method expects a field called uid_foreign)
Returns:
An array of attributes

tx_commerce_belib::getAttributesForProduct pUid,
separateCT1 = false,
addAttributeData = false,
getValueListData = false
 

Fetches all attribute relation from the database that are assigned to a product specified through pUid. It can also fetch information about the attribute and a list of attribute values if the attribute has a valuelist.

Parameters:
integer $pUid: The uid of the product
boolean $separateCT1: If this is true, all attributes with ct1 will be saved in a separated result section
boolean $addAttributeData: If true, all information about the attributes will be fetched from the database (default is false)
boolean $getValueListData: If this is true and additional data is fetched and an attribute has a valuelist, this gets the values for the list (default is false)
Returns:
An array of attributes

tx_commerce_belib::getAttributeTitle aUid  ) 
 

Returns the title of an attribute.

Parameters:
integer $aUid: The UID of the attribute
Returns:
The title of the attribute as string

tx_commerce_belib::getAttributeTitles attributeList,
uidField = 'uid'
 

Returns a list of Titles for a list of attributes.

Parameters:
array $attributeList: An array of attributes (complete datasets with at least one field that contains the UID of an attribute)
string $uidField: The name of the array key in the attributeList that contains the UID
Returns:
An array of attribute titles as strings

tx_commerce_belib::getAttributeValue pUid,
aUid,
relationTable,
relationData = NULL,
attributeData = NULL
 

This fetches the value for an attribute. It fetches the "default_value" from the table if the attribute has no valuelist, otherwise it fetches the title from the attribute_values table. You can submit only an attribute uid, then the mehod fetches the data from the databse itself, or you submit the data from the relation table and the data from the attribute table if this data is already present.

Parameters:
integer $pUid: The product UID
integer $aUid: The attribute UID
string $relationTable: The table where the relations between prodcts and attributes are stored
array $relationData: The relation dataset between the product and the attribute (default NULL)
array $attributeData: The meta data (has_valuelist, unit) for the attribute you want to get the value from (default NULL)
Returns:
The value of the attribute. It's maybe appended with the unit of the attribute

tx_commerce_belib::getCategoriesForProductFromDB pUid  ) 
 

This gets all categories for a product from the database.

Parameters:
integer $pUid: The UID of the product
Returns:
An array of UIDs of all categories for this product

tx_commerce_belib::getCategoryData cUid,
select = '*',
groupBy = '',
orderBy = ''
 

Returns an array with the data for a single category.

Parameters:
integer $cUid: The UID of the category
string $select: The WHERE part of the query
string $groupBy: The GROUP BY part of the query
string $orderBy: The ORDER BY part of the query
Returns:
An associative array with the data of the category

tx_commerce_belib::getChildCategories cUid,
&$  cUidList,
dontAdd = 0,
excludeUid = 0,
recursive = true
 

Get all categories that have this one as parent.

Parameters:
integer $cUid: The UID of the category that is the startingpoint
array $cUidList: A list of category UIDs. PASSED BY REFERENCE
integer $dontAdd: A single UID, if this is found in the parent results, it's not added to the list
integer $excludeUid: If the current cUid is like this UID the cUid is not processed at all
boolean $recursive: If true, this method calls itself for each category if finds
Returns:
void

tx_commerce_belib::getCtForAttributeOfProduct aUid,
pUid
 

Returns the correlationtype of a special attribute inside a product.

Parameters:
integer $aUid: The UID of the attribute
integer $pUid: The UID of the product
Returns:
The correlationtype

tx_commerce_belib::getOrderFolderSelector pid,
levels,
aktLevel = 0
 

tx_commerce_belib::getParentCategories cUid,
&$  cUidList,
dontAdd = 0,
excludeUid = 0,
recursive = true
 

Fetch all parent categories for a given category.

Parameters:
integer $cUid: The UID of the category that is the startingpoint
array $cUidList: A list of category UIDs. PASSED BY REFERENCE
integer $dontAdd: A single UID, if this is found in the parent results, it's not added to the list
integer $excludeUid: If the current cUid is like this UID the cUid is not processed at all
boolean $recursive: If true, this method calls itself for each category if finds
Returns:
void

tx_commerce_belib::getParentCategoriesFromList &$  cUidList  ) 
 

Get all parent categories for a list of given categories. This method calls the "getParentCategories" method. That one will work recursive. The result will be written into the argument cUidList.

Parameters:
array $cUidList: The list of category UIDs PASSED BY REFERENCE
Returns:
void

tx_commerce_belib::getProductOfArticle aUid,
getProductData = '*'
 

Returns the product from which an article was created.

Parameters:
integer $aUid: Article UID
string $getProductData: which fields should be returned of the product. This is a comma separated list (default *)
Returns:
If the "getProductData" param is empty, this returnss the UID as integer, otherwise it returns an associative array of the dataset

tx_commerce_belib::getProductsOfCategory cUid  ) 
 

Return all productes that are related to a category.

Parameters:
uid $cUid: The UID of the category.
Returns:
An array with the entities of the found products

tx_commerce_belib::getUidFromKey key,
&$  keyData
 

This method returns the last part of a string. It splits up the string at the underscores. If the key doesn't contain any underscores, it returns the intval of the key.

Parameters:
string $key: The key string (e.g.: bla_fasel_12)
array $keyData: the result from the explode method (PASSED BY REFERENCE)
Returns:
Integer value of the last part from the key
Since:
13.12.2005 changed $keyData from refference to Array ingo schmitt <is@marketing-factory.de>

03.01.2006 changed $keyData to refference from Array ingo schmitt <is@marketing-factory.de>

tx_commerce_belib::getUidListFromList list  ) 
 

Returns a list of UID from a list of strings that contains UIDs.

See also:
$this->getUidFromKey
Parameters:
array $list: The list of strings
Returns:
An array with extracted UIDs

tx_commerce_belib::getUpdateData attributeData,
data,
productUid = ''
 

Retruns and array for the UPDATEquery method. It fills different arrays with an attribute value. This wraper is needed because the fields have different names in different tables. I know that's stupid but this is a fact... :-/

Parameters:
array $attributeData: The data that should be stored
mixed $data: The value of the attribute
integer $productUid: The UID of the produt
Returns:
An array with two arrays as elements

tx_commerce_belib::isNumber data  ) 
 

proofs if there are non numeric chars in it

Parameters:
string $data: string to check for a number
Returns:
length of wrong chars

tx_commerce_belib::mergeAttributeListFromFFData ffData,
prefix,
ctList,
uid_local,
&$  paList
 

Merges an attribute list from a flexform together into one array.

Parameters:
array $ffData: The FlexForm data as array
string $prefix: The prefix that is used for the correlationtypes
array $ctList: The list of correlations that should be processed
integer $uid_local: The "uid_local" in the relation table
array $paList: The list of product attributes (PASSED BY REFERENCE)
Returns:
void

tx_commerce_belib::savePriceFlexformWithArticle priceUid,
articleUid,
priceDataArray
 

save Price-Flexform with given Article-UID

Author:
Joerg Sprung <jsp-factory>
Parameters:
integer $priceUid ID of Price-Dataset save as flexform
integer $articleUid ID of article which the flexform is for
array $priceDataArray Priceinformation for the article
Returns:
boolean Status of method
See also:
tx_commerce_belib

tx_commerce_belib::saveRelations uid_local,
relationData,
relationTable,
delete = false,
withReference = true
 

Saves all relations between two tables. For example all relations between products and articles.

Parameters:
integer $uid_local: The uid_local in the mm table
array $relationData: An array with the data that should be stored additionally in the relation table
string $relationTable: The table where the relations are stored
boolean $delete: Delete all old relations
boolean $withReference: If true, the field "is_reference" is inserted into the database
Returns:
void

tx_commerce_belib::updateArticleHash aUid,
fullAttributeList = NULL
 

Updates an article and recalculates the hash value for the assigned attributes.

Parameters:
integer $aUid: the uid of the article
array $fullAttributeList: The list of uids for the attributes that are assigned to the article

tx_commerce_belib::updateArticleXML articleRelations,
add = false,
articleUid = NULL,
productUid = NULL
 

Updates the XML of an article. This is neccessary because if we change anything in a category we also change all related products and articles. This has to be done in two steps. At first we have to update the relations in the database. But if we do so, the user won't recognize the changes in the backend because of the usage of flexforms. So this method, updates all the flexform value data in the database for the articles we change.

See also:
$this->updateXML
Parameters:
array $articleRelations: The relation dataset for the article
boolean $add: If this is true, we fetch the existing data before. Otherwise we overwrite it
integer $articleUid: The UID of the article
integer $productUid: The UID of the product
Returns:
void
Build Relation Data

tx_commerce_belib::updatePriceXMLFromDatabase articleUid  ) 
 

update Flexform XML from Database

Author:
Christian Sander <cs2-factory>
Parameters:
integer $articleUid ID of article
Returns:
boolean Status of method
See also:
tx_commerce_belib

tx_commerce_belib::updateXML xmlField,
table,
uid,
type,
ctList
 

Updates the XML of an FlexForm value field. This is almost the same as "updateArticleXML" but more general.

See also:
$this->updateArticleXML
Parameters:
string $xmlField: The fieldname where the FlexForm values are stored
string $table: The table in which the FlexForm values are stored
integer $uid: The UID of the entity inside the table
string $type: The type of data we are handling (category, product)
array $ctList: A list of correlationtype UID we should handle
Returns:
array array($xmlField => $xmlData)


The documentation for this class was generated from the following file:
Generated on Sun Jan 13 23:12:18 2008 for tx_commerce by  doxygen 1.4.4