6

I am looking at core code now, going over things preparing for sitting certification and for the first time have come across resource helpers.

I am a little confused actually as at first it looks as though these should be intended for 'helper' type tasks relating specifically to resource models, i.e. database related generel tasks.

However, they are used so infrequently in core code that im doubting that assumption. If this were true I can see a ton of places throughout core code they could be put to use but are not.

Can anyone explain exactly what these are to be used for and if they are still used or it is more a legacy thing?

4

Resource Helpers were introduced in magento 1.6 CE and magento 1.11 EE, and is part of the database abstraction that was introduced in those versions.

so its the other way round: The code that is not using them is the legacy code.

you can read more in this document: http://www.magentocommerce.com/images/uploads/RDBMS_Guide2.pdf

from it:

A Resource Helper is a new classification in Magento's vocabulary. This entity belongs to the abstraction layer and is designed for the same purpose as an adapter – it abstracts specifics of communication the database.

1
  • 1
    It should be noted that Magento 1 never really fixed its leaky database abstraction, so this is all nice theory but in the end you'll always use the MySQL resource helper. – Fabian Schmengler Jul 20 '15 at 10:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.