How to load user relations on login, PHP?

Hi you all,

I’d like to know if there is a way which allows me to load the user’s relation once logged in, via PHP.
For instance, I have a user related with a Car table, and there is a Data Object Relationship field in my User table.

How can I load data about the Car related to the logged in User, using PHP?

use backendless\Backendless;

use backendless\exception\BackendlessException;
// Backendless data
include 'backendless/autoload.php';

$APP_ID = '***';

$REST_KEY = '**';

$VERSION = '**';

// Application init

Backendless::initApp($APP_ID, $REST_KEY, $VERSION);

$email = "";
$password = "john";

$result = array();

$resultValue = false;

try {
    Backendless::$UserService->login($email, $password); 

    $loginUser = Backendless::$UserService->CurrentUser();

    if ($loginUser != null) {
            $userToken = Backendless::$UserService->getUserToken();

            $result['result'] = true;
            $result['token'] = $userToken;
            // ??? DATA from RELATION with Car Table ???
    } else {
        $result['result'] = false;

        $result['message'] = 'User han not been logged.';
} catch (BackendlessException $e) {
    $result['error'] = $e;
$result['result'] = $resultValue;
echo json_encode($result);

Could you help me please?

Thank you in advance!


Try set relation property as autoload on console.