PHP Classes

File: www/Config/Sql/Private/CustomerDB/Groups/AdminGroup/PUT/Registration.php

Recommend this page to a friend!
  Packages of Ramesh Narayan Jangid (Sharma)   PHP Microservices Framework   www/Config/Sql/Private/CustomerDB/Groups/AdminGroup/PUT/Registration.php   Download  
File: www/Config/Sql/Private/CustomerDB/Groups/AdminGroup/PUT/Registration.php
Role: Auxiliary script
Content type: text/plain
Description: Configuration script
Class: PHP Microservices Framework
Setup microservices apps with configuration arrays
Author: By
Last change: refactor
Date: 19 hours ago
Size: 1,679 bytes
 

Contents

Class file image Download
<?php

/**
 * API Query config
 * php version 8.3
 *
 * @category API_Query_Config
 * @package Microservices
 * @author Ramesh N. Jangid (Sharma) <polygon.co.in@gmail.com>
 * @copyright © 2026 Ramesh N. Jangid (Sharma)
 * @license MIT https://opensource.org/license/mit
 * @link https://github.com/polygoncoin/Microservices
 * @since Class available since Release 1.0.0
 */

use Microservices\App\DatabaseServerDataType;

return
array_merge(
    require
$this->http->req->QUERIES_DIR
       
. DIRECTORY_SEPARATOR . 'CustomerDB'
       
. DIRECTORY_SEPARATOR . 'Common'
       
. DIRECTORY_SEPARATOR . 'Registration.php',
    [
       
'__SET__' => [
            [
               
'column' => 'firstname',
               
'fetchFrom' => 'payload',
               
'fetchFromData' => 'firstname'
           
],
            [
               
'column' => 'lastname',
               
'fetchFrom' => 'payload',
               
'fetchFromData' => 'lastname'
           
],
            [
               
'column' => 'email',
               
'fetchFrom' => 'payload',
               
'fetchFromData' => 'email'
           
],
            [
               
'column' => 'username',
               
'fetchFrom' => 'payload',
               
'fetchFromData' => 'username'
           
],
            [
               
'column' => 'password_hash',
               
'fetchFrom' => 'function',
               
'fetchFromData' => function($session) {
                    if (
                        isset(
$session['payload'])
                        && isset(
$session['payload']['password'])
                    ) {
                        return
password_hash(
                           
password: $session['payload']['password'],
                           
algo: PASSWORD_DEFAULT
                       
);
                    }
                }
            ]
        ],
       
'__WHERE__' => [
            [
               
'column' => 'is_deleted',
               
'fetchFrom' => 'custom',
               
'fetchFromData' => 'No'
           
],
            [
               
'column' => 'id',
               
'fetchFrom' => 'routeParamArr',
               
'fetchFromData' => 'id',
               
'dataType' => DatabaseServerDataType::$PrimaryKey
           
]
        ],
    ]
);