PHP Classes

File: Config/Queries/ClientDB/GET/CRUD.php

Recommend this page to a friend!
  Classes of Ramesh Narayan Jangid   PHP Microservices Framework   Config/Queries/ClientDB/GET/CRUD.php   Download  
File: Config/Queries/ClientDB/GET/CRUD.php
Role: Configuration script
Content type: text/plain
Description: Configuration script
Class: PHP Microservices Framework
Setup microservices apps with configuration arrays
Author: By
Last change: changes
Date: 8 months ago
Size: 886 bytes
 

Contents

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

use
App\HttpRequest;

return [
   
'all' => [
       
'countQuery' => "SELECT count(1) as `count` FROM `{$this->clientDB}`.`".HttpRequest::$input['uriParams']['table']."` WHERE __WHERE__",
       
'query' => "SELECT * FROM `{$this->clientDB}`.`".HttpRequest::$input['uriParams']['table']."` WHERE __WHERE__",
       
'where' => [
           
'is_deleted' => ['custom', 'No']
        ],
       
'mode' => 'multipleRowFormat'//Multiple rows returned.
   
],
   
'single' => [
       
'query' => "SELECT * FROM `{$this->clientDB}`.`".HttpRequest::$input['uriParams']['table']."` WHERE __WHERE__",
       
'where' => [
           
'is_deleted' => ['custom', 'No'],
           
'id' => ['uriParams','id']
        ],
       
'mode' => 'singleRowFormat'//Single row returned.
   
]
][isset(
HttpRequest::$input['uriParams']['id'])?'single':'all'];