Class Mage_Core_Helper_Data

Description

Core data helper

Located in /Core/Helper/Data.php (line 32)

Mage_Core_Helper_Abstract
   |
   --Mage_Core_Helper_Data
Direct descendents
Class Description
Mage_Adminhtml_Helper_Catalog_Product_Edit_Action_Attribute Adminhtml catalog product action attribute update helper
Mage_Adminhtml_Helper_Dashboard_Abstract Adminhtml abstract dashboard helper.
Mage_Adminhtml_Helper_Dashboard_Data Data helper for dashboard
Mage_GiftMessage_Helper_Message Gift Message helper
Mage_Connect_Helper_Data Default helper of the module
Mage_ImportExport_Helper_Data ImportExport data helper
Mage_Sales_Helper_Data Sales module base helper
Mage_Sales_Helper_Reorder Sales module base helper
Mage_Media_Helper_Data Media library data helper
Class Constant Summary
XML_PATH_DEFAULT_COUNTRY = 'general/country/default'
Variable Summary
Method Summary
static mixed currency (float $value, [bool $format = true], [bool $includeContainer = true])
static mixed currencyByStore (float $value, [int|Mage_Core_Model_Store $store = null], [bool $format = true], [bool $includeContainer = true])
SimpleXMLElement assocToXml ( $array, [string $rootName = '_'])
boolean copyFieldset (string $fieldset, string $aspect, array|Varien_Object $source, array|Varien_Object $target, [string $root = 'global'])
mixed decorateArray (mixed $array, [string $prefix = 'decorated_'], [bool $forceSetAll = false])
string decrypt (string $data)
string encrypt (string $data)
string formatCurrency (float $value, [bool $includeContainer = true])
string formatDate ([date|Zend_Date|null $date = null], [string $format = 'short'], [bool $showTime = false])
string formatPrice (float $price, [bool $includeContainer = true])
string formatTime ([date|Zend_Date|null $time = null], [string $format = 'short'], [ $showDate = false], bool $showTime)
array getCacheTypes ()
string getDefaultCountry ([Mage_Core_Model_Store|string|int $store = null])
void getHash (string $password, [string|integer|boolean $salt = false])
void getRandomString ( $len, [ $chars = null])
int getStoreId ([mixed $store = null])
void isDevAllowed ([ $storeId = null])
mixed jsonDecode (string $encodedValue, [ $objectDecodeType = Zend_Json::TYPE_ARRAY])
string jsonEncode (mixed $valueToEncode, [boolean $cycleCheck = false], [array $options = array()])
bool|string mergeFiles ( $srcFiles, [string|false $targetFile = false], [bool $mustMerge = false], [callback $beforeMergeCallback = null], [array|string $extensionsFilter = array()])
void removeAccents ( $string, [ $german = false])
string uniqHash ([$prefix $prefix = ''])
void validateHash ( $password,  $hash)
void validateKey ( $key)
array xmlToAssoc ( $xml)
Variables
Methods
static method currency (line 67)

Convert and format price value for current application store

  • access: public
static mixed currency (float $value, [bool $format = true], [bool $includeContainer = true])
  • float $value
  • bool $format
  • bool $includeContainer
static method currencyByStore (line 81)

Convert and format price value for specified store

  • access: public
static mixed currencyByStore (float $value, [int|Mage_Core_Model_Store $store = null], [bool $format = true], [bool $includeContainer = true])
assocToXml (line 500)

Transform an assoc array to SimpleXMLElement object Array has some limitations. Appropriate exceptions will be thrown

  • throws: Exception
  • access: public
SimpleXMLElement assocToXml ( $array, [string $rootName = '_'])
  • array $array
  • string $rootName
copyFieldset (line 366)

Copy data from object|array to object|array containing fields from fieldset matching an aspect.

Contents of $aspect are a field name in target object or array. If '*' - will be used the same name as in the source object or array.

  • access: public
boolean copyFieldset (string $fieldset, string $aspect, array|Varien_Object $source, array|Varien_Object $target, [string $root = 'global'])
  • string $fieldset
  • string $aspect
  • array|Varien_Object $source
  • array|Varien_Object $target
  • string $root
decorateArray (line 435)

Decorate a plain array of arrays or objects The array actually can be an object with Iterator interface

Keys with prefix_* will be set: *_is_first - if the element is first *_is_odd / *_is_even - for odd/even elements *_is_last - if the element is last

The respective key/attribute will be set to element, depending on object it is or array. Varien_Object is supported.

$forceSetAll true will cause to set all possible values for all elements. When false (default), only non-empty values will be set.

  • access: public
mixed decorateArray (mixed $array, [string $prefix = 'decorated_'], [bool $forceSetAll = false])
  • mixed $array
  • string $prefix
  • bool $forceSetAll
decrypt (line 214)

Decrypt data using application key

  • access: public
string decrypt (string $data)
  • string $data
encrypt (line 200)

Encrypt data using application key

  • access: public
string encrypt (string $data)
  • string $data
formatCurrency (line 104)

Format and convert currency using current store option

  • access: public
string formatCurrency (float $value, [bool $includeContainer = true])
  • float $value
  • bool $includeContainer
formatDate (line 129)

Format date using current locale options

  • access: public
string formatDate ([date|Zend_Date|null $date = null], [string $format = 'short'], [bool $showTime = false])
  • date|Zend_Date|null $date: in GMT timezone
  • string $format
  • bool $showTime
formatPrice (line 116)

Formats price

  • access: public
string formatPrice (float $price, [bool $includeContainer = true])
  • float $price
  • bool $includeContainer
formatTime (line 165)

Format time using current locale options

  • access: public
string formatTime ([date|Zend_Date|null $time = null], [string $format = 'short'], [ $showDate = false], bool $showTime)
  • date|Zend_Date|null $time
  • string $format
  • bool $showTime
  • $showDate
getCacheBetaTypes (line 340)

Get information about available cache beta types

  • access: public
array getCacheBetaTypes ()
getCacheTypes (line 325)

Get information about available cache types

  • access: public
array getCacheTypes ()
getDefaultCountry (line 728)

Return default country code

  • access: public
string getDefaultCountry ([Mage_Core_Model_Store|string|int $store = null])
getEncryptor (line 44)
  • access: public
Mage_Core_Model_Encryption getEncryptor ()
getHash (line 245)

Generate salted hash from password

  • access: public
void getHash (string $password, [string|integer|boolean $salt = false])
  • string $password
  • string|integer|boolean $salt
getRandomString (line 227)
  • access: public
void getRandomString ( $len, [ $chars = null])
  • $len
  • $chars
getStoreId (line 261)

Retrieve store identifier

  • access: public
int getStoreId ([mixed $store = null])
  • mixed $store
isDevAllowed (line 303)
  • access: public
void isDevAllowed ([ $storeId = null])
  • $storeId
jsonDecode (line 617)

Decodes the given $encodedValue string which is encoded in the JSON format

  • access: public
mixed jsonDecode (string $encodedValue, [ $objectDecodeType = Zend_Json::TYPE_ARRAY])
  • string $encodedValue
  • $objectDecodeType
jsonEncode (line 596)

Encode the mixed $valueToEncode into the JSON format

  • access: public
string jsonEncode (mixed $valueToEncode, [boolean $cycleCheck = false], [array $options = array()])
  • mixed $valueToEncode
  • boolean $cycleCheck: Optional; whether or not to check for object recursion; off by default
  • array $options: Additional options used during encoding
mergeFiles (line 648)

Merge specified files into one

By default will not merge, if there is already merged file exists and it was modified after its components If target file is specified, will attempt to write merged contents into it, otherwise will return merged content May apply callback to each file contents. Callback gets parameters: (<existing system filename>, <file contents>) May filter files by specified extension(s) Returns false on error

  • access: public
bool|string mergeFiles ( $srcFiles, [string|false $targetFile = false], [bool $mustMerge = false], [callback $beforeMergeCallback = null], [array|string $extensionsFilter = array()])
  • array $srcFiles
  • string|false $targetFile: - file path to be written
  • bool $mustMerge
  • callback $beforeMergeCallback
  • array|string $extensionsFilter
removeAccents (line 266)
  • access: public
void removeAccents ( $string, [ $german = false])
  • $string
  • $german
uniqHash (line 627)

Generate a hash from unique ID

  • access: public
string uniqHash ([$prefix $prefix = ''])
  • $prefix $prefix
validateHash (line 250)
  • access: public
void validateHash ( $password,  $hash)
  • $password
  • $hash
validateKey (line 222)
  • access: public
void validateKey ( $key)
  • $key
xmlToAssoc (line 563)

Transform SimpleXMLElement to associative array SimpleXMLElement must be conform structure, generated by assocToXml()

  • access: public
array xmlToAssoc ( $xml)
  • SimpleXMLElement $xml

Inherited Methods

Inherited From Mage_Core_Helper_Abstract

Mage_Core_Helper_Abstract::escapeHtml()
Mage_Core_Helper_Abstract::escapeUrl()
Mage_Core_Helper_Abstract::getLayout()
Mage_Core_Helper_Abstract::htmlEscape()
Mage_Core_Helper_Abstract::isModuleEnabled()
Mage_Core_Helper_Abstract::isModuleOutputEnabled()
Mage_Core_Helper_Abstract::jsQuoteEscape()
Mage_Core_Helper_Abstract::setLayout()
Mage_Core_Helper_Abstract::stripTags()
Mage_Core_Helper_Abstract::translateArray()
Mage_Core_Helper_Abstract::urlDecode()
Mage_Core_Helper_Abstract::urlEncode()
Mage_Core_Helper_Abstract::urlEscape()
Mage_Core_Helper_Abstract::_cleanCache()
Mage_Core_Helper_Abstract::_getModuleName()
Mage_Core_Helper_Abstract::_getRequest()
Mage_Core_Helper_Abstract::_getUrl()
Mage_Core_Helper_Abstract::_loadCache()
Mage_Core_Helper_Abstract::_removeCache()
Mage_Core_Helper_Abstract::_saveCache()
Mage_Core_Helper_Abstract::__()
Class Constants
XML_PATH_DEFAULT_COUNTRY = 'general/country/default' (line 34)

Documentation generated on Fri, 11 Feb 2011 17:00:33 +0200 by phpDocumentor 1.4.3