diff --git a/src/Traction/DynamicResponse.php b/src/Traction/DynamicResponse.php index eccfb5d..5373a3d 100644 --- a/src/Traction/DynamicResponse.php +++ b/src/Traction/DynamicResponse.php @@ -22,10 +22,19 @@ public function __construct(TransportResponse $response) /** * get raw data array - * @return Array + * @param $attribute String attribute name + * + * @return Mixed */ - public function getData() { - return $this->data; + public function getData($attribute=null) { + if(isset($this->data)) { + if($attribute === null) { + return $this->data; + } else if(isset($this->data->$attribute)) { + return $this->data->$attribute; + } + } + return null; } /**