PHP Classes

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

Recommend this page to a friend!
  Classes of Ramesh Narayan Jangid   Open Swoole Microservices   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: Open Swoole Microservices
Implement microservices using Open Swoole
Author: By
Last change: Refactor
Date: 6 days ago
Size: 1,184 bytes
 

Contents

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

use
Microservices\App\Constants;

return [
   
'all' => [
       
'countQuery' => "SELECT count(1) as `count` FROM `{$Env::$clients}` WHERE __WHERE__",
       
'query' => "SELECT * FROM `{$Env::$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 `{$Env::$clients}` WHERE __WHERE__",
       
'__CONFIG__' => [// [{payload/uriParams}, key/index, {Constants::$REQUIRED}]
           
['uriParams', 'client_id', Constants::$REQUIRED],
        ],
       
'__WHERE__' => [
           
'is_approved' => ['custom', 'Yes'],
           
'is_disabled' => ['custom', 'No'],
           
'is_deleted' => ['custom', 'No'],
           
'client_id' => ['uriParams','client_id']
        ],
       
'mode' => 'singleRowFormat'//Single row returned.
   
],
][isset(
$this->c->httpRequest->conditions['uriParams']['client_id'])?'single':'all'];