public function getOwner(HTTPRequest $request)
    {
        $owner = null;

        //get the token
        $token = $request->getHeader($this->tokenConfig['header']);
        if (!$token) {
            $token = $request->requestVar($this->tokenConfig['queryVar']);
        }

        if ($token) {
            $SQLToken = Convert::raw2sql($token);

            $owner = DataObject::get_one(
                $this->tokenConfig['owner'],
                "\"" . $this->tokenConfig['DBColumn'] . "\"='" . $SQLToken . "'",
                false
            );

            if (!$owner) {
                $owner = null;
            }
        }

        return $owner;
    }
public function getOwner(HTTPRequest $request)
    {
        $owner = null;

        //get the token
        $token = $request->getHeader($this->tokenConfig['header']);
        if (!$token) {
            $token = $request->requestVar($this->tokenConfig['queryVar']);
        }

        if ($token) {
            $SQLToken = Convert::raw2sql($token);

            $owner = DataObject::get_one(
                $this->tokenConfig['owner'],
                "\"" . $this->tokenConfig['DBColumn'] . "\"='" . $SQLToken . "'",
                false
            );

            if (!$owner) {
                $owner = null;
            }
        }

        return $owner;
    }
public function getOwner ( HTTPRequest $ request ) { $ owner = null ; //get the token $ token = $ request -> getHeader ( $ this -> tokenConfig [ 'header' ] ) ; if ( ! $ token ) { $ token = $ request -> requestVar ( $ this -> tokenConfig [ 'queryVar' ] ) ; } if ( $ token ) { $ SQLToken = Convert :: raw2sql ( $ token ) ; $ owner = DataObject :: get_one ( $ this -> tokenConfig [ 'owner' ] , "\"" . $ this -> tokenConfig [ 'DBColumn' ] . "\"='" . $ SQLToken . "'" , false ) ; if ( ! $ owner ) { $ owner = null ; } } return $ owner ; }
Returns the DataObject related to the token
that sent the authenticated request

@param  HTTPRequest          $request    HTTP API request
@return null|DataObject                     null if failed or the DataObject token owner related to the request
Returns the DataObject related to the token that sent the authenticated request