<?php

/**
 * Created by PhpStorm.
 * User: Claudio
 * Date: 04/04/2020
 * Time: 15:52
 */
class LeituraRestService extends \Adianti\Service\AdiantiRecordService
{
    const DATABASE      = 'jackpot';
    const ACTIVE_RECORD = 'Leitura';

    public static function getUsuario( $request )
    {
        TTransaction::open('jackpot');
        $response = array();

        // carrega os contatos
        $all = Leitura::where('usuario', '=', $request['usuario'])->load();
        foreach ($all as $product)
        {
            $response[] = $product->toArray();
        }
        TTransaction::close();
        return $response;
    }

}
?>