Skip to content

Instantly share code, notes, and snippets.

View svenvarkel's full-sized avatar

Sven Varkel svenvarkel

View GitHub Profile
@svenvarkel
svenvarkel / gist:6559077
Created September 14, 2013 05:35
My_Custom_Trait_Extension_B_Model_Product
trait My_Custom_Trait_Extension_A_Model_Product{
/**
* This method loads the original, rewritten class of
* Extension_B_Model_Product. Mind the shorthand - you need
* to load correct original class.
* $this becomes later part of My_Custom_Model_Product context
*/
protected function getInstance()
{
if ( is_null($this->_instance) )
@svenvarkel
svenvarkel / Product.php
Created September 14, 2013 05:26
trait My_Custom_Trait_Extension_A_Model_Product
trait My_Custom_Trait_Extension_A_Model_Product{
/**
* This method loads the original, rewritten class of
* Extension_A_Model_Product. Mind the shorthand - you need
* to load correct original class.
* $this becomes later part of My_Custom_Model_Product context
*/
protected function getInstance()
{
if ( is_null($this->_instance) )
@svenvarkel
svenvarkel / My_Custom.xml
Last active December 23, 2015 01:09
Magento module XML with dependencies
<config>
<modules>
<My_Custom>
<active>true</active>
<codePool>local</codePool>
<depends>
<Extension_A />
<Extension_B />
</depends>
</My_Custom>