PHP Classes
elePHPant
Icontem

File: sample/Cst/select/index.php

Recommend this page to a friend!
  Classes of Rafael Becker  >  PHP Expressive  >  sample/Cst/select/index.php  >  Download  
File: sample/Cst/select/index.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Expressive
Base class for Object Relational Mapping
Author: By
Last change:
Date: 1 month ago
Size: 855 bytes
 

Contents

Class file image Download
<?php

require_once '../../../vendor/autoload.php';

use
Solis\Breaker\Abstractions\TExceptionAbstract;
use
Sample\Cst\Classes\Cst;

try {

    require
'../../Database/config.php';

   
$result = (new Cst())
        ->
select(
            [],
            [
               
"orderBy" => [
                   
"column" => "cstcodigo",
                   
"direction" => "asc",
                ],
               
"limit" => [
                   
"number" => 1,
                   
//"offset" => 10
               
],
            ]
        );


    if (!empty(
$result)) {
        if (
is_array($result)) {
            foreach (
$result as $item) {
               
var_dump($item->toArray());
            }
        } else {
           
var_dump($result->toArray());
        }
    }

} catch (
TExceptionAbstract $exception) {
    echo
$exception->toJson();
}