PHP Classes

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

Recommend this page to a friend!
  Classes of Ramesh Narayan Jangid   PHP Microservices Framework   Config/Queries/GlobalDB/GET/groups.php   Download  
File: Config/Queries/GlobalDB/GET/groups.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: Refactor
Date: 8 days ago
Size: 1,079 bytes
 

Contents

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

use
Microservices\App\Constants;

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