src/Dlin/Zendesk/Client/BaseClient.php
protected function getOne($end_point)
    {

        $end_point = strtolower($end_point);
        if (strpos($end_point, 'http') !== 0) {
            $end_point = $this->api->getApiUrl() . $end_point;
        }


        $request = $this->api->get($end_point);
        $response = $this->processRequest($request);
        $result = $response->json();

        $type = $this->getType();
        $className = explode('\\', $type);
        $baseName = strtolower(end($className));


        if ($result && isset($result[$baseName])) {
            $t = new $type();
            $t->setManagingClient($this);
            return $t->fromArray($result[$baseName]);
        }
        return null;

    }
protected function getOne($end_point)
    {

        $end_point = strtolower($end_point);
        if (strpos($end_point, 'http') !== 0) {
            $end_point = $this->api->getApiUrl() . $end_point;
        }


        $request = $this->api->get($end_point);
        $response = $this->processRequest($request);
        $result = $response->json();

        $type = $this->getType();
        $className = explode('\\', $type);
        $baseName = strtolower(end($className));


        if ($result && isset($result[$baseName])) {
            $t = new $type();
            $t->setManagingClient($this);
            return $t->fromArray($result[$baseName]);
        }
        return null;

    }
protected function getOne ( $ end_point ) { $ end_point = strtolower ( $ end_point ) ; if ( strpos ( $ end_point , 'http' ) !== 0 ) { $ end_point = $ this -> api -> getApiUrl ( ) . $ end_point ; } $ request = $ this -> api -> get ( $ end_point ) ; $ response = $ this -> processRequest ( $ request ) ; $ result = $ response -> json ( ) ; $ type = $ this -> getType ( ) ; $ className = explode ( '\\' , $ type ) ; $ baseName = strtolower ( end ( $ className ) ) ; if ( $ result && isset ( $ result [ $ baseName ] ) ) { $ t = new $ type ( ) ; $ t -> setManagingClient ( $ this ) ; return $ t -> fromArray ( $ result [ $ baseName ] ) ; } return null ; }
Generic function for getting one entity

@param $end_point
@return \Dlin\Zendesk\Entity\BaseEntity
Generic function for getting one entity