
Protected Member Functions | |
| _updateAttributes ($data, $object, $type, array $attributes=null) | |
| _getAttributes ($object, $type, array $attributes=null) | |
| _isAllowedAttribute ($attributeCode, $type, array $attributes=null) | |
Protected Attributes | |
| $_ignoredAttributeCodes | |
| $_attributesMap | |
Definition at line 34 of file Resource.php.
| _getAttributes | ( | $ | object, | |
| $ | type, | |||
| array $ | attributes = null | |||
| ) | [protected] |
Retrieve entity attributes values
| Mage_Core_Model_Abstract | $object | |
| array | $attributes |
Definition at line 81 of file Resource.php.
00082 { 00083 $result = array(); 00084 00085 if (!is_object($object)) { 00086 return $result; 00087 } 00088 00089 foreach ($object->getData() as $attribute=>$value) { 00090 if ($this->_isAllowedAttribute($attribute, $type, $attributes)) { 00091 $result[$attribute] = $value; 00092 } 00093 } 00094 00095 foreach ($this->_attributesMap['global'] as $alias=>$attributeCode) { 00096 $result[$alias] = $object->getData($attributeCode); 00097 } 00098 00099 if (isset($this->_attributesMap[$type])) { 00100 foreach ($this->_attributesMap[$type] as $alias=>$attributeCode) { 00101 $result[$alias] = $object->getData($attributeCode); 00102 } 00103 } 00104 00105 return $result; 00106 }
| _isAllowedAttribute | ( | $ | attributeCode, | |
| $ | type, | |||
| array $ | attributes = null | |||
| ) | [protected] |
Check is attribute allowed to usage
| Mage_Eav_Model_Entity_Attribute_Abstract | $attribute | |
| string | $entityType | |
| array | $attributes |
Definition at line 116 of file Resource.php.
00117 { 00118 if (!empty($attributes) 00119 && !(in_array($attributeCode, $attributes))) { 00120 return false; 00121 } 00122 00123 if (in_array($attributeCode, $this->_ignoredAttributeCodes['global'])) { 00124 return false; 00125 } 00126 00127 if (isset($this->_ignoredAttributeCodes[$type]) 00128 && in_array($attributeCode, $this->_ignoredAttributeCodes[$type])) { 00129 return false; 00130 } 00131 00132 return true; 00133 }
| _updateAttributes | ( | $ | data, | |
| $ | object, | |||
| $ | type, | |||
| array $ | attributes = null | |||
| ) | [protected] |
Update attributes for entity
| array | $data | |
| Mage_Core_Model_Abstract | $object | |
| array | $attributes |
Definition at line 62 of file Resource.php.
00063 { 00064 00065 foreach ($data as $attribute=>$value) { 00066 if ($this->_isAllowedAttribute($attribute, $type, $attributes)) { 00067 $object->setData($attribute, $value); 00068 } 00069 } 00070 00071 return $this; 00072 }
$_attributesMap [protected] |
$_ignoredAttributeCodes [protected] |
Initial value:
Definition at line 41 of file Resource.php.
1.5.8