1: <?php
2: /**
3: * Magento
4: *
5: * NOTICE OF LICENSE
6: *
7: * This source file is subject to the Open Software License (OSL 3.0)
8: * that is bundled with this package in the file LICENSE.txt.
9: * It is also available through the world-wide-web at this URL:
10: * http://opensource.org/licenses/osl-3.0.php
11: * If you did not receive a copy of the license and are unable to
12: * obtain it through the world-wide-web, please send an email
13: * to license@magentocommerce.com so we can send you a copy immediately.
14: *
15: * DISCLAIMER
16: *
17: * Do not edit or add to this file if you wish to upgrade Magento to newer
18: * versions in the future. If you wish to customize Magento for your
19: * needs please refer to http://www.magentocommerce.com for more information.
20: *
21: * @category Mage
22: * @package Mage_Paypal
23: * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24: * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25: */
26:
27: /**
28: * Payflow Link request model
29: *
30: * @category Mage
31: * @package Mage_Paypal
32: * @author Magento Core Team <core@magentocommerce.com>
33: */
34:
35: class Mage_Paypal_Model_Payflow_Request extends Varien_Object
36: {
37: /**
38: * Set/Get attribute wrapper
39: * Also add length path if key contains = or &
40: *
41: * @param string $method
42: * @param array $args
43: * @return mixed
44: */
45: public function __call($method, $args)
46: {
47: $key = $this->_underscore(substr($method,3));
48: if (isset($args[0]) && (strstr($args[0], '=') || strstr($args[0], '&'))) {
49: $key .= '[' . strlen($args[0]) . ']';
50: }
51: switch (substr($method, 0, 3)) {
52: case 'get' :
53: //Varien_Profiler::start('GETTER: '.get_class($this).'::'.$method);
54: $data = $this->getData($key, isset($args[0]) ? $args[0] : null);
55: //Varien_Profiler::stop('GETTER: '.get_class($this).'::'.$method);
56: return $data;
57:
58: case 'set' :
59: //Varien_Profiler::start('SETTER: '.get_class($this).'::'.$method);
60: $result = $this->setData($key, isset($args[0]) ? $args[0] : null);
61: //Varien_Profiler::stop('SETTER: '.get_class($this).'::'.$method);
62: return $result;
63:
64: case 'uns' :
65: //Varien_Profiler::start('UNS: '.get_class($this).'::'.$method);
66: $result = $this->unsetData($key);
67: //Varien_Profiler::stop('UNS: '.get_class($this).'::'.$method);
68: return $result;
69:
70: case 'has' :
71: //Varien_Profiler::start('HAS: '.get_class($this).'::'.$method);
72: //Varien_Profiler::stop('HAS: '.get_class($this).'::'.$method);
73: return isset($this->_data[$key]);
74: }
75: throw new Varien_Exception("Invalid method ".get_class($this)."::".$method."(".print_r($args,1).")");
76: }
77: }
78: