PHP Classes

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

Recommend this page to a friend!
  Classes of Ramesh Narayan Jangid (Sharma)   PHP Microservices Framework   public_html/Config/Queries/Auth/GlobalDB/GET/groups.php   Download  
File: public_html/Config/Queries/Auth/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: Moved Common to non-static class
Date: 1 month ago
Size: 1,985 bytes
 

Contents

Class file image Download
<?php

/**
 * API Query config
 * php version 8.3
 *
 * @category API_Query_Config
 * @package Microservices
 * @author Ramesh N Jangid <[email protected]>
 * @copyright 2025 Ramesh N Jangid
 * @license MIT https://opensource.org/license/mit
 * @link https://github.com/polygoncoin/Microservices
 * @since Class available since Release 1.0.0
 */

namespace Microservices\public_html\Config\Queries\Auth\GlobalDB\GET;

use
Microservices\App\Common;

return [
   
'all' => [
       
'__QUERY__' => 'SELECT * FROM `{$Env::$groups}` WHERE __WHERE__ ORDER BY id ASC',
       
'__WHERE__' => [
            [
               
'column' => 'is_approved',
               
'fetchFrom' => 'custom',
               
'fetchFromValue' => 'Yes'
           
],
            [
               
'column' => 'is_disabled',
               
'fetchFrom' => 'custom',
               
'fetchFromValue' => 'No'
           
],
            [
               
'column' => 'is_deleted',
               
'fetchFrom' => 'custom',
               
'fetchFromValue' => 'No'
           
],
        ],
       
'__MODE__' => 'multipleRowFormat'
   
],
   
'single' => [
       
'__QUERY__' => 'SELECT * FROM `{$Env::$groups}` WHERE __WHERE__',
       
'__WHERE__' => [
            [
               
'column' => 'is_approved',
               
'fetchFrom' => 'custom',
               
'fetchFromValue' => 'Yes'
           
],
            [
               
'column' => 'is_disabled',
               
'fetchFrom' => 'custom',
               
'fetchFromValue' => 'No'
           
],
            [
               
'column' => 'is_deleted',
               
'fetchFrom' => 'custom',
               
'fetchFromValue' => 'No'
           
],
            [
               
'column' => 'id',
               
'fetchFrom' => 'routeParams',
               
'fetchFromValue' => 'id'
           
],
        ],
       
'__MODE__' => 'singleRowFormat'
   
]
][isset(
$this->api->req->s['routeParams']['id'])?'single':'all'];