This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<config> | |
<modules> | |
<My_Custom> | |
<active>true</active> | |
<codePool>local</codePool> | |
<depends> | |
<Extension_A /> | |
<Extension_B /> | |
</depends> | |
</My_Custom> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class My_Custom_Model_Product extends Mage_Catalog_Model_Product{ | |
use My_Custom_Trait_Extension_A_Model_Product, My_Custom_Trait_Extension_B_Model_Product; | |
public function doSomethingCustomerSpecific(){ | |
//here we do smth customer specific | |
// AND now it's possible to use methods from traits - | |
// it means - from Extension_A and Extension_B Product models | |
$this->fixSomethingByProduct(); | |
} | |
public function getSomethingFromSomewhere(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<models> | |
<mycustom> | |
<class>My_Custom_Model</class> | |
</mycustom> | |
<catalog> | |
<rewrite> | |
<product>My_Custom_Model_Product</product> | |
</rewrite> | |
</catalog> | |
</models> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class My_Custom_Model_Product extends Mage_Catalog_Model_Product{ | |
public function doSomethingCustomerSpecific(){ | |
//here we do smth customer specific | |
} | |
public function getSomethingFromSomewhere(){ | |
//here we get something from somewhere | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Extension_B_Model_Product extends Mage_Catalog_Model_Product{ | |
public function isAvailable(){ | |
//does some complex calculations or check's for availability in real time... | |
} | |
public function fixSomethingByProduct(){ | |
//fix something by product that needs to be fixed | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Extension_A_Model_Product extends Mage_Catalog_Model_Product | |
public function doSomethingImportant(){ | |
//does something important | |
} | |
public function transformProductDescription(){ | |
//transforms product descripton to something else | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
/** | |
* create_magento_admin_user.php | |
* | |
* Place this file to utils folder, one folder | |
* up from your web root. If your web root is something | |
* else than htdocs then change the path below accordingly. | |
* | |
* This script creates Magento admin user to current |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: jira | |
# Required-Start: $local_fs $remote_fs $network $syslog nginx | |
# Required-Stop: $local_fs $remote_fs $network $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts jira server | |
# Description: starts jira using start-stop-daemon |
OlderNewer