PHP Classes

File: Config/Queries/ClientDB/Common/Address.php

Recommend this page to a friend!
  Classes of Ramesh Narayan Jangid   PHP Microservices Framework   Config/Queries/ClientDB/Common/Address.php   Download  
File: Config/Queries/ClientDB/Common/Address.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: Refactoring
Date: 2 months ago
Size: 776 bytes
 

Contents

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

use
Microservices\App\Constants;
use
Microservices\App\Env;
use
Microservices\App\HttpRequest;

return [
   
'query' => "UPDATE `{$Env::$clientDB}`.`address` SET __SET__ WHERE __WHERE__",
   
'__CONFIG__' => [// [{payload/uriParams}, key/index, {Constants::$REQUIRED}]
       
['uriParams', 'id', Constants::$REQUIRED],
    ],
   
'__WHERE__' => [
       
'is_deleted' => ['custom', 'No'],
       
'id' => ['uriParams', 'id']
    ],
   
'validate' => [
        [
           
'fn' => 'primaryKeyExist',
           
'fnArgs' => [
               
'table' => ['custom', 'address'],
               
'primary' => ['custom', 'id'],
               
'id' => ['uriParams', 'id']
            ],
           
'errorMessage' => 'Invalid address id'
       
],
    ]
];