<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 *
 * @category    Artio
 * @package     Artio_MTurbo
 * @copyright   Copyright (c) 2010 Artio (http://www.artio.net)
 * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 */

/**
 * Main container
 *
 * @category   Artio
 * @package    Artio_MTurbo
 * @author     Artio Magento Team (info@artio.net)
 */
abstract class Artio_MTurbo_Block_Dynamic extends Mage_Core_Block_Template
{

    
    /**
     * Get block identifier.
     * 
     * @return string 
     */
    protected function _getMTurboId()
    {
    	return $this->getData('identifier');
    }
    
    
    /**
     * Get cleared block identifer.
     * 
     * Method returns identifier as Artio_MTurbo_Block_Ajax::getId(),
     * where all occurences '.' or '$' are replaced by '_'.
     * 
     * "Clear Id" is used as JavaScript identifier, therefore there must
     * not contain with '.' or '$'.
     * 
     * @return string
     */
    protected function _getMTurboClearId()
    {
    	return str_replace(array('.', '$'), array('_','_'), $this->_getMTurboId());
    }

    
    /**
     * (non-PHPdoc)
     */
    public function __call($method, $args) {
    	// do nothing, this prevents "undefined method" errors 
    	// when a method of the original block is called
    }
    
    
    /**
     * (non-PHPdoc)
     */
    public static function __callStatic($name, $arguments) {
    	// do nothing, this prevents "undefined method" errors 
    	// when a method of the original block is called
    }

    
}