PHP Classes

File: Config/Queries/GlobalDB/GET/clients.php

Recommend this page to a friend!
  Classes of Ramesh Narayan Jangid   PHP Microservices Framework   Config/Queries/GlobalDB/GET/clients.php   Download  
File: Config/Queries/GlobalDB/GET/clients.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Microservices Framework
Setup microservices apps with configuration arrays
Author: By
Last change: refactoring
Date: 29 days ago
Size: 1,107 bytes
 

Contents

Class file image Download
<?php
namespace Config\Queries\GlobalDB\GET;

use
App\HttpRequest;

return [
   
'all' => [
       
'countQuery' => "SELECT count(1) as `count` FROM `{$this->globalDB}`.`{$this->execPhpFunc(getenv('clients'))}` WHERE __WHERE__",
       
'query' => "SELECT * FROM `{$this->globalDB}`.`{$this->execPhpFunc(getenv('clients'))}` WHERE __WHERE__ ORDER BY client_id ASC",
       
'where' => [
           
'is_approved' => ['custom', 'Yes'],
           
'is_disabled' => ['custom', 'No'],
           
'is_deleted' => ['custom', 'No']
            ],
       
'mode' => 'multipleRowFormat'//Multiple rows returned.
   
],
   
'single' => [
       
'query' => "SELECT * FROM `{$this->globalDB}`.`{$this->execPhpFunc(getenv('clients'))}` WHERE __WHERE__",
       
'where' => [
           
'is_approved' => ['custom', 'Yes'],
           
'is_disabled' => ['custom', 'No'],
           
'is_deleted' => ['custom', 'No'],
           
'client_id' => ['uriParams','client_id']
        ],
       
'mode' => 'singleRowFormat'//Single row returned.
   
],
][isset(
HttpRequest::$input['uriParams']['client_id'])?'single':'all'];