Tutti i seguenti metodi sono usati nel core di Magento, quindi qual è il modo preferito (o l'ultimo "best practice")?
Mage::throwException('Some Message')- 732 Usithrow new Exception('Some Message')- 419 Usithrow Mage::exception('Vendor_Module', 'Some Message')- 94 Usi
(è necessario creare unaVendor_Module_Exceptionclasse)
grep -r throwException /path/to/magento/app/code/core | wc -l ; grep -r throw\ new /path/to/magento/app/code/core | wc -l ; grep -r throw\ Mage /path/to/magento/app/code/core | wc -l- anche se questo richiede che tu sappia cosa anche cercare.