PHP code example of ethosce / lookmlphp

1. Go to this page and download the library: Download ethosce/lookmlphp library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ethosce / lookmlphp example snippets



use LookML\Model;

// Define the model and connection
$model = new Model();
$model->set('connection', 'pgsql');

// Comments and ->set(''uid')
    ->set('relationship', 'many_to_one');

// Explore on users
$user = $model->explore('user')
  ->set('label', 'Users');
  
// Render LookML
print $model;


use LookML\View;

$user = new View('user');
$user->dimension('uid')
  ->set('type', 'number');
$user->dimension('name')
  ->set('type', 'string');
// Render the view.
print $user;

$order = new View('order');

$order = new View('order');
$order->dimension('order_id')
  ->set('type', 'number');
print $order;