Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AuthorizedRequest.php
Go to the documentation of this file.
1 <?php
23 #require_once 'Zend/Oauth/Token.php';
24 
32 {
36  protected $_data = array();
37 
45  public function __construct(array $data = null, Zend_Oauth_Http_Utility $utility = null)
46  {
47  if ($data !== null) {
48  $this->_data = $data;
49  $params = $this->_parseData();
50  if (count($params) > 0) {
51  $this->setParams($params);
52  }
53  }
54  if ($utility !== null) {
55  $this->_httpUtility = $utility;
56  } else {
57  $this->_httpUtility = new Zend_Oauth_Http_Utility;
58  }
59  }
60 
66  public function getData()
67  {
68  return $this->_data;
69  }
70 
76  public function isValid()
77  {
78  if (isset($this->_params[self::TOKEN_PARAM_KEY])
79  && !empty($this->_params[self::TOKEN_PARAM_KEY])
80  ) {
81  return true;
82  }
83  return false;
84  }
85 
91  protected function _parseData()
92  {
93  $params = array();
94  if (empty($this->_data)) {
95  return;
96  }
97  foreach ($this->_data as $key => $value) {
98  $params[rawurldecode($key)] = rawurldecode($value);
99  }
100  return $params;
101  }
102 }
setParams(array $params)
Definition: Token.php:157
$value
Definition: gender.phtml:16
__construct(array $data=null, Zend_Oauth_Http_Utility $utility=null)
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE]
Definition: website.php:18