Class Varien_Object

Description

Implements interfaces:

  • ArrayAccess (internal interface)

Varien Object

Located in /Object.php (line 35)


	
			
Direct descendents
Class Description
Varien_Crypt_Abstract Abstract class for crypter classes
Varien_Data_Form_Abstract Abstract class for form, coumn and fieldset
Varien_Data_Tree_Node Data tree node
Varien_Simplexml_Config_Cache_Abstract Abstract class for configuration cache
Varien_Event_Observer Event observer object
Varien_Event Event object and dispatcher
Varien_Filter_Template_Simple Magento
Variable Summary
static array $_underscoreCache
array $_data
$_hasDataChange $_hasDataChanges
string $_idFieldName
boolean $_isDeleted
array $_origData
Method Summary
Varien_Object __construct ()
boolean dataHasChangedFor (string $field)
string debug ([mixed $data = null], [ &$objects = array()], array $objects)
Varien_Object flagDirty (string $field, [boolean $flag = true])
mixed getData ([string $key = ''], [string|int $index = null])
mixed getDataSetDefault (string $key, mixed $default)
mixed getDataUsingMethod (string $key, [mixed $args = null])
mixed getId ()
Varien_Object getIdFieldName (string $name)
mixed getOrigData ([string $key = null])
boolean hasData ([string $key = ''])
bool hasDataChanges ()
boolean isDeleted ([boolean $isDeleted = null])
boolean isDirty ([string $field = null])
boolean isEmpty ()
boolean offsetExists (string $offset)
mixed offsetGet (string $offset)
void offsetSet (string $offset, mixed $value)
void offsetUnset (string $offset)
string serialize ([array $attributes = array()], [string $valueSeparator = '='], [string $fieldSeparator = ' '], [string $quote = '"'])
Varien_Object setData (string|array $key, [mixed $value = null])
Varien_Object setDataChanges (boolean $value)
Varien_Object setDataUsingMethod (string $key, [mixed $args = array()])
Varien_Object setId (mixed $value)
Varien_Object setIdFieldName (string $name)
Varien_Object setOrigData ([string $key = null], [mixed $data = null])
array toArray ([ $arrAttributes = array()])
string toJson ([ $arrAttributes = array()])
string toString ([string $format = ''])
string toXml ([ $arrAttributes = array()], [string $rootName = 'item'], [ $addOpenTag = false], [ $addCdata = true])
Varien_Object unsetData ([string $key = null])
void _camelize ( $name)
void _construct ()
mixed _getData (string $key)
array _prepareArray ( &$arr, [ $elements = array()], array $arr)
string _underscore (string $name)
mixed __call (string $method, array $args)
mixed __get (string $var)
void __set (string $var, mixed $value)
array __toArray ([ $arrAttributes = array()])
string __toJson ([ $arrAttributes = array()])
string __toXml ([ $arrAttributes = array()], [string $rootName = 'item'], [ $addOpenTag = false], [ $addCdata = true])
Variables
static array $_underscoreCache = array() (line 70)

Setter/Getter underscore transformation cache

  • access: protected
array $_data = array() (line 43)

Object attributes

  • access: protected
$_hasDataChange $_hasDataChanges = false (line 49)

Data changes flag (true after setData|unsetData call)

  • var: bool
  • access: protected
string $_idFieldName = null (line 63)

Name of object id field

  • access: protected
boolean $_isDeleted = false (line 77)

Object delete flag

  • access: protected
array $_origData (line 56)

Original data that was loaded

  • access: protected
Methods
Constructor __construct (line 86)

Constructor

By default is looking for first argument as array and assignes it as object attributes This behaviour may change in child classes

  • access: public
Varien_Object __construct ()

Redefined in descendants as:
addData (line 189)

Add data to the object.

Retains previous data in the object.

  • access: public
Varien_Object addData ( $arr)
  • array $arr
dataHasChangedFor (line 699)

Compare object data with original data

  • access: public
boolean dataHasChangedFor (string $field)
  • string $field
debug (line 725)

Present object data as string in debug mode

  • access: public
string debug ([mixed $data = null], [ &$objects = array()], array $objects)
  • mixed $data
  • array $objects
  • &$objects
flagDirty (line 820)

Enter description here...

  • access: public
Varien_Object flagDirty (string $field, [boolean $flag = true])
  • string $field
  • boolean $flag
getData (line 252)

Retrieves data from the object

If $key is empty will return all the data as an array Otherwise it will return value of the attribute specified by $key

If $index is specified it will assume that attribute data is an array and retrieve corresponding member.

  • access: public
mixed getData ([string $key = ''], [string|int $index = null])
  • string $key
  • string|int $index
getDataSetDefault (line 354)

Fast get data or set default if value is not available

  • access: public
mixed getDataSetDefault (string $key, mixed $default)
  • string $key
  • mixed $default
getDataUsingMethod (line 341)

Get object data by key with calling getter method

  • access: public
mixed getDataUsingMethod (string $key, [mixed $args = null])
  • string $key
  • mixed $args
getId (line 157)

Retrieve object id

  • access: public
mixed getId ()

Redefined in descendants as:
getIdFieldName (line 147)

Retrieve name of object id field

  • access: public
Varien_Object getIdFieldName (string $name)
  • string $name
getOrigData (line 668)

Get object loaded data (original data)

  • access: public
mixed getOrigData ([string $key = null])
  • string $key
hasData (line 369)

If $key is empty, checks whether there's any data in the object Otherwise checks if the specified attribute is set.

  • access: public
boolean hasData ([string $key = ''])
  • string $key
hasDataChanges (line 124)

Get data change status

  • access: public
bool hasDataChanges ()
isDeleted (line 110)

Set _isDeleted flag value (if $isDeleted param is defined) and return current flag value

  • access: public
boolean isDeleted ([boolean $isDeleted = null])
  • boolean $isDeleted
isDirty (line 802)

Enter description here...

  • access: public
boolean isDirty ([string $field = null])
  • string $field
isEmpty (line 602)

checks whether the object is empty

  • access: public
boolean isEmpty ()
offsetExists (line 767)

Implementation of ArrayAccess::offsetExists()

boolean offsetExists (string $offset)
  • string $offset

Implementation of:
ArrayAccess::offsetExists
offsetGet (line 790)

Implementation of ArrayAccess::offsetGet()

mixed offsetGet (string $offset)
  • string $offset

Implementation of:
ArrayAccess::offsetGet
offsetSet (line 755)

Implementation of ArrayAccess::offsetSet()

void offsetSet (string $offset, mixed $value)
  • string $offset
  • mixed $value

Implementation of:
ArrayAccess::offsetSet
offsetUnset (line 778)

Implementation of ArrayAccess::offsetUnset()

void offsetUnset (string $offset)
  • string $offset

Implementation of:
ArrayAccess::offsetUnset
serialize (line 645)

serialize object attributes

  • access: public
string serialize ([array $attributes = array()], [string $valueSeparator = '='], [string $fieldSeparator = ' '], [string $quote = '"'])
  • array $attributes
  • string $valueSeparator
  • string $fieldSeparator
  • string $quote

Redefined in descendants as:
setData (line 209)

Overwrite data in the object.

$key can be string or array. If $key is string, the attribute value will be overwritten by $value

If $key is an array, it will overwrite all the data in the object.

  • access: public
Varien_Object setData (string|array $key, [mixed $value = null])
  • string|array $key
  • mixed $value
setDataChanges (line 712)

Clears data changes status

  • access: public
Varien_Object setDataChanges (boolean $value)
  • boolean $value
setDataUsingMethod (line 327)

Set object data with calling setter method

  • access: public
Varien_Object setDataUsingMethod (string $key, [mixed $args = array()])
  • string $key
  • mixed $args
setId (line 171)

Set object id field value

  • access: public
Varien_Object setId (mixed $value)
  • mixed $value

Redefined in descendants as:
setIdFieldName (line 135)

set name of object id field

  • access: public
Varien_Object setIdFieldName (string $name)
  • string $name
setOrigData (line 683)

Initialize object original data

  • access: public
Varien_Object setOrigData ([string $key = null], [mixed $data = null])
  • string $key
  • mixed $data
toArray (line 407)

Public wrapper for __toArray

  • access: public
array toArray ([ $arrAttributes = array()])
  • array $arrAttributes
toJson (line 492)

Public wrapper for __toJson

  • access: public
string toJson ([ $arrAttributes = array()])
  • array $arrAttributes
toString (line 518)

Public wrapper for __toString

Will use $format as an template and substitute {{key}} for attributes

  • access: public
string toString ([string $format = ''])
  • string $format
toXml (line 468)

Public wrapper for __toXml

  • access: public
string toXml ([ $arrAttributes = array()], [string $rootName = 'item'], [ $addOpenTag = false], [ $addCdata = true])
  • array $arrAttributes
  • string $rootName
  • $addOpenTag
  • $addCdata
unsetData (line 228)

Unset data from the object.

$key can be a string only. Array will be ignored.

  • access: public
Varien_Object unsetData ([string $key = null])
  • string $key
_camelize (line 631)
  • access: protected
void _camelize ( $name)
  • $name
_construct (line 100)

Internal constructor not depended on params. Can be used for object initialization

  • access: protected
void _construct ()
_getData (line 315)

Get value from _data array without parse key

  • access: protected
mixed _getData (string $key)
  • string $key
_prepareArray (line 419)

Set required array elements

  • access: protected
array _prepareArray ( &$arr, [ $elements = array()], array $arr)
  • array $arr
  • array $elements
  • &$arr
_underscore (line 619)

Converts field names for setters and geters

$this->setMyField($value) === $this->setData('my_field', $value) Uses cache to eliminate unneccessary preg_replace

  • access: protected
string _underscore (string $name)
  • string $name
__call (line 539)

Set/Get attribute wrapper

  • access: public
mixed __call (string $method, array $args)
  • string $method
  • array $args
__get (line 579)

Attribute getter (deprecated)

  • access: public
mixed __get (string $var)
  • string $var
__set (line 591)

Attribute setter (deprecated)

  • access: public
void __set (string $var, mixed $value)
  • string $var
  • mixed $value
__toArray (line 383)

Convert object attributes to array

  • access: public
array __toArray ([ $arrAttributes = array()])
  • array $arrAttributes: array of required attributes

Redefined in descendants as:
__toJson (line 479)

Convert object attributes to JSON

  • access: protected
string __toJson ([ $arrAttributes = array()])
  • array $arrAttributes: array of required attributes
__toXml (line 436)

Convert object attributes to XML

  • access: protected
string __toXml ([ $arrAttributes = array()], [string $rootName = 'item'], [ $addOpenTag = false], [ $addCdata = true])
  • array $arrAttributes: array of required attributes
  • string $rootName: name of the root element
  • $addOpenTag
  • $addCdata

Documentation generated on Fri, 11 Feb 2011 16:53:21 +0200 by phpDocumentor 1.4.3