PHP Classes

File: Config/Queries/ClientDB/PATCH/Registration.php

Recommend this page to a friend!
  Classes of Ramesh Narayan Jangid   Open Swoole Microservices   Config/Queries/ClientDB/PATCH/Registration.php   Download  
File: Config/Queries/ClientDB/PATCH/Registration.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
Date: 13 days ago
Size: 778 bytes
 

Contents

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

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