Skip to content

Instantly share code, notes, and snippets.

@Rokko11
Rokko11 / gist:6376918
Created August 29, 2013 11:28
How to add foreign key from bundle_option to cms_block
/** @var $installer Mage_Catalog_Model_Resource_Setup */
$installer = $this;
$installer->startSetup();
$installer->getConnection()->addColumn($installer->getTable('bundle/option'), 'block_id',
array(
'nullable' => true,
'unsigned' => true,
'type' => Varien_Db_Ddl_Table::TYPE_INTEGER,
@Rokko11
Rokko11 / openligadb_ruby_rails_example_snippet
Created August 10, 2013 20:26
Getting Information of OpenLigaDb with Ruby in a Rails project
# This snippet works with Ruby Gem "Savon"
client = Savon.client(wsdl: "http://www.OpenLigaDB.de/Webservices/Sportsdata.asmx?WSDL")
method = "get_matchdata_by_league_date_time"
message = {from_date_time: 5.hours.ago, to_date_time: Time.now, league_shortcut: 'bl1'}
result = client.call(:"#{method}", message: message)
data_array = result.body[:"#{method}_response"][:"#{method}_result"][:matchdata]
data_array.each do |data|
puts data[:match_id]
end