public function getResource($application = null)
    {
        if ($application === null) {
            $application = $this->getWebhook()->getApplication();
        }

        $url = new URL($application, $this->getResourceUrl());
        $request = new Request($application, $url, Request::METHOD_GET);
        $request->send();

        foreach ($request->getResponse()->getElements() as $element) {
            $class = $this->getEventClass();
            if ($class === null) {
                return $element;
            } else {
                $model = new $class($application);
                $model->fromStringArray($element);

                return $model;
            }
        }
    }
public function getResource($application = null)
    {
        if ($application === null) {
            $application = $this->getWebhook()->getApplication();
        }

        $url = new URL($application, $this->getResourceUrl());
        $request = new Request($application, $url, Request::METHOD_GET);
        $request->send();

        foreach ($request->getResponse()->getElements() as $element) {
            $class = $this->getEventClass();
            if ($class === null) {
                return $element;
            } else {
                $model = new $class($application);
                $model->fromStringArray($element);

                return $model;
            }
        }
    }
public function getResource ( $ application = null ) { if ( $ application === null ) { $ application = $ this -> getWebhook ( ) -> getApplication ( ) ; } $ url = new URL ( $ application , $ this -> getResourceUrl ( ) ) ; $ request = new Request ( $ application , $ url , Request :: METHOD_GET ) ; $ request -> send ( ) ; foreach ( $ request -> getResponse ( ) -> getElements ( ) as $ element ) { $ class = $ this -> getEventClass ( ) ; if ( $ class === null ) { return $ element ; } else { $ model = new $ class ( $ application ) ; $ model -> fromStringArray ( $ element ) ; return $ model ; } } }
Fetches the resource and, if possible, loads it into it's respective model class

@param  \XeroPHP\Application $application an optional application instance to use to retrieve the remote resource.
Useful if you have separate instances with different oauth tokens based on the tenant
@return \XeroPHP\Remote\Model|array If the event category is known, returns the model, otherwise, returns the resource as an array
Fetches the resource and if possible loads it into it s respective model class