I have been using magento for a while and always cannot decide between using magic getter and getData ()
Can someone explain the main difference besides the minor overhead (and it should be very small).
I mean:
There is no clear way to switch to base code, as it uses a mixture of both
, - getData($key). , . , getData getData(). , -. -, , , ( , getName() , ). getData().
getData($key)
getData()
, , , , , .
, CamelCase under_score .
getData() .
, :
getAttributeName(), getData ('attribute_name')
- , , getAttributeName(), . , getData(), , , .
, getData . 2 :
getData
1) , - _underscore Varien_Object ( ).
_underscore
2) getData , "" , , getData, , .
Varien_Object, :
Varien_Object
$firstObject->getData('second_object')->getData('third_object')->getData('some_string');
:
$firstObject->getData('second_object/third_object/some_string');