PHP Classes

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

Recommend this page to a friend!
  Classes of Ramesh Narayan Jangid (Sharma)   Open Swoole Microservices   Config/Queries/GlobalDB/PUT/clients.php   Download  
File: Config/Queries/GlobalDB/PUT/clients.php
Role: Auxiliary script
Content type: text/plain
Description: Configuration script
Class: Open Swoole Microservices
Implement microservices using Open Swoole
Author: By
Last change: Refactoring
Refactoring
Date: 20 days ago
Size: 1,015 bytes
 

 

Contents

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

use
Microservices\App\Constants;
use
Microservices\App\DatabaseDataTypes;
use
Microservices\App\Env;

return [
   
'query' => "UPDATE `{$Env::$clients}` SET __SET__ WHERE __WHERE__",
   
'__SET__' => [
       
'name' => ['payload', 'name'],
       
'comments' => ['payload', 'comments'],
       
'updated_by' => ['userDetails', 'user_id'],
       
'updated_on' => ['custom', date('Y-m-d H:i:s')]
    ],
   
'__WHERE__' => [
       
'is_approved' => ['custom', 'Yes'],
       
'is_disabled' => ['custom', 'No'],
       
'is_deleted' => ['custom', 'No'],
       
'client_id' => ['uriParams', 'client_id', DatabaseDataTypes::$INT]
    ],
   
'validate' => [
        [
           
'fn' => 'primaryKeyExist',
           
'fnArgs' => [
               
'table' => ['custom', Env::$clients],
               
'primary' => ['custom', 'client_id'],
               
'id' => ['payload', 'client_id', DatabaseDataTypes::$INT]
            ],
           
'errorMessage' => 'Invalid Client Id'
       
],
    ]
];