JBZoo\Data\Data::get PHP Method

get() public method

Get a value from the data given its key
public get ( string $key, mixed $default = null, mixed $filter = null ) : mixed
$key string The key used to fetch the data
$default mixed The default value
$filter mixed Filter returned value
return mixed
    public function get($key, $default = null, $filter = null)
    {
        $result = $default;
        if ($this->has($key)) {
            $result = $this->offsetGet($key);
        }
        return $this->_filter($result, $filter);
    }

Usage Example

コード例 #1
0
ファイル: Http.php プロジェクト: JBZoo/CrossCMS
 /**
  * {@inheritdoc}
  */
 protected function _compactResponse($apiResponse)
 {
     $dataResponse = new Data($apiResponse);
     $response = array('code' => $dataResponse->find('response.code', 0, 'int'), 'headers' => array_change_key_case((array) $dataResponse->get('headers', array()), CASE_LOWER), 'body' => $dataResponse->get('body'));
     $response = new Data($response);
     return $response;
 }
All Usage Examples Of JBZoo\Data\Data::get